?? computer locker - fancy delphi application contest entry #47.htm
字號:
ALG_CLASS_HASH = (4 <b>SHL</b> 13) ;<br /> ALG_TYPE_ANY = 0;<br /> ALG_SID_MD5 = 3;<br /> CALG_MD5 = (ALG_CLASS_HASH <b>Or</b> ALG_TYPE_ANY <b>Or</b> ALG_SID_MD5) ;<br /><b>var</b><br /> hCryptProvider : ULONG;<br /> hHash : ULONG;<br /> bHash : <b>Array</b>[0..$7F] <b>Of</b> Byte;<br /> dwHashLen : DWORD;<br /> pbContent : PByte;<br /> cnt : Integer;<br /><b>begin</b><br /> dwHashLen := 16;<br /> pbContent := Pointer(PChar(Input)) ;<br /> Result := '';<br /> <b>If</b> CryptAcquireContext(@hCryptProvider,<b>nil</b>,<b>nil</b>,PROV_RSA_FULL,CRYPT_VERIFYCONTEXT Or CRYPT_MACHINE_KEYSET) <b>Then</b><br /> <b>begin</b><br /> <b>If</b> CryptCreateHash(hCryptProvider,CALG_MD5,0,0,@hHash) <b>Then</b><br /> <b>begin</b><br /> <b>If</b> CryptHashData(hHash,pbContent,Length(Input),0) <b>Then</b><br /> <b>begin</b><br /> <b>If</b> CryptGetHashParam(hHash,HP_HASHVAL,@bHash[0],@dwHashLen,0) <b>Then</b><br /> <b>begin</b><br /> <b>For</b> cnt := 0 <b>To</b> dwHashLen - 1 <b>Do</b><br /> <b>begin</b><br /> Result := Result + Format('%.2x',[bHash[cnt]]) ;<br /> <b>end</b>;<br /> <b>end</b>;<br /> <b>end</b>;<br /> CryptDestroyHash(hHash) ;<br /> <b>end</b>;<br /> CryptReleaseContext(hCryptProvider, 0) ;<br /> <b>end</b>;<br /> Result := AnsiLowerCase(Result) ;<br /><b>end</b>;<br /></blockquote><p>"Computer Locker" was submitted by Dagan Hoover.<p>Do you have a FDA(C)? Submit your Delphi code to the <a href="/od/humorandfun/a/fany_contest.htm">Fancy Delphi Application Contest</a>. <!--/gc--></div> <div id="coda"><div id="resources"><div class="lkbx"><div class="obO"><h5>D O W N L O A D</h5><p><a href="/library/code/computerlock-exe.zip" onClick="zIlb(this)">Computer Locker EXECUTABLE</a><a href="/library/code/computer-lock-src.zip" onClick="zIlb(this)">Computer Locker SOURCE CODE</a></p></div></div><div class="lkbx"><div class="obS"><h5>Suggested Reading</h5><p><a href="/od/humorandfun/a/fdac_shutdown.htm" onClick="zIlb(this)">Windows Shut Down / Restart / Log Off - Fancy Delphi Application Contest Ent...</a><a href="/od/humorandfun/a/fdac_task_mgr.htm" onClick="zIlb(this)">Task Manager Clone - Fancy Delphi Application Contest Entry #24</a><a href="/od/fullcodeprojects/a/fdac_tabinstall.htm" onClick="zIlb(this)">Take-A-Break Installer - Fancy Delphi Application Contest Entry #34</a></p></div></div><script type="text/javascript">w('<div id="ll"><h5>New posts to the <a href="http://forums.about.com/ab-delphi/start/?lgnF=y" zT="18/1My" >Delphi Programming forums</a>:</h5><ul><li><a href="http://forums.about.com/dir-app/acx/ACDispatch.aspx?action=message&webtag=ab-delphi&msg=17876" zT="18/1My">D 2009; Frames; Runtime creation of comp</a></li><li><a href="http://forums.about.com/dir-app/acx/ACDispatch.aspx?action=message&webtag=ab-delphi&msg=17841" zT="18/1My">Problem Writting component</a></li><li><a href="http://forums.about.com/dir-app/acx/ACDispatch.aspx?action=message&webtag=ab-delphi&msg=7465" zT="18/1My">Reading C code in Win32 API</a></li></ul></div>')</script><div id="related"><h5> Related Articles</h5><ul><li><a href="http://linux.about.com/od/emacs_doc/a/emacsdoc358.htm" zT="18/1YL/Zn">Emacs Documentation - Name Help</a></li><li><a href="http://delphi.about.com/library/dpbr/blbr1556225563.htm" zT="18/1YL/Zn">Review: The Tomes of Delphi: Win32 Core API</a></li><li><a href="http://delphi.about.com/od/objectpascalide/a/recursion.htm" zT="18/1YL/Zn">Understanding Recursive Functions in Delphi</a></li><li><a href="http://delphi.about.com/od/delphitips2008/qt/return_strings.htm" zT="18/1YL/Zn">Need to Return a TStringList (any object) from a Delphi Function?</a></li><li><a href="http://saltaquarium.about.com/library/blank/blpcontestentriesjan012.htm" zT="18/1YL/Zn">About Saltwater Aquariums January 2001 Fish & Critter Photo Contest #2 ...</a></li></ul></div></div><div id="guideinfo"><div class="cntnr"><div id="thumb"><a href="/mbiopage.htm" zT="18/1YK"><img src="http://z.about.com/d/g/3522.jpg" alt="Zarko Gajic"></a></div><div class="est">Guide since 1998</div><p><a href="/mbiopage.htm" zT="18/1YO">Zarko Gajic</a><br>Delphi Programming Guide</p><ul><li><a href="/gi/pages/stay.htm" zT="18/1YS"><strong>Sign up</strong> for my Newsletter</a></li></ul><ul class="social"><li><a href="/b/" zT="18/1YM">My Blog</a></li><li><a href="http://forums.about.com/n/pfx/forum.aspx?nav=messages&webtag=ab-delphi" zT="18/1YN">My Forum</a></li></ul></div></div></div><script type="text/javascript">zSbL=3;zSB(2);zSbL=0</script></div><div id="widgets"><script type="text/javascript">if(z336>0){w('<div id="adB">'+ap[0]+at[4]+as[0]);adunit('','','about.com',ch,gs,336,280,'1','bb',3);w('</div>')}if(z155>0){w('<div id="adP">'+ap[0]+at[4]+as[0]);adunit('','','about.com',ch,gs,336,155,'1','ps',4);w('</div>')}</script><script type="text/javascript">if(zp[7].d){Dsp(zp[7],'ip')}</script><script type="text/javascript">if(zp[11].d){Dsp(zp[11],'ip')}</script></div></div><div id="browse" class="pane clear"><h3>Explore Delphi Programming</h3><div id="bc1"><h5>Must Reads</h5><ul><li><a href="/cs/azindex/a/blnewcomers.htm" zT="18/1fG/1">First Time Here? What is Delphi?</a></li><li><a href="/od/objectpascalide/bb/delphi_project.htm" zT="18/1fG/2">Before You Start a New Project...</a></li><li><a href="/od/beginners/a/delphicourses.htm" zT="18/1fG/3">Delphi Tutorials / Online Courses</a></li><li><a href="/od/faqstipstricks/a/DelphiTips.htm" zT="18/1fG/4">Delphi Tips, Tricks, Code Snippets</a></li><li><a href="/od/beginners/u/delphi_basics.htm#s3" zT="18/1fG/5">Free Delphi Source Code</a></li></ul><div class="lkbx"><div class="obM" id="ob/O3"><h5>Most Popular</h5><p><a href="http://delphi.about.com/od/delphichallengesexercises/qt/delphi-extract-base-path-challenge.htm" onClick="zT(this,'18/yV/O3')">Delphi Challenge: ExtractBaseP</a><a href="http://delphi.about.com/od/fullcodeprojects/l/aa112903a.htm" onClick="zT(this,'18/yV/O3')">Network traffic monitor</a><a href="http://delphi.about.com/od/objectpascalide/l/blvkc.htm" onClick="zT(this,'18/yV/O3')">Virtual Key Codes</a><a href="http://delphi.about.com/cs/adptips2004/a/bltip0204_3.htm" onClick="zT(this,'18/yV/O3')">Delphi Tips 233 - 236</a><a href="http://delphi.about.com/od/beginners/a/delphicourse.htm" onClick="zT(this,'18/yV/O3')">A Beginner's Guide to Delphi</a></p></div></div></div><div id="bc2"><form class="nl" name="subscription" action="http://clk.about.com/" method="get" alert="Please enter a valid email address."><label for="nTxt">Free Delphi Programming Newsletter!</label><input type="hidden" name="zi" value="18/1gG"><input type="hidden" name="surl" value="http://delphi.about.com/gi/pages/mmail.htm"><input type="hidden" name="eurl" value="http://delphi.about.com/gi/pages/mmail.htm"><input type="hidden" name="cmd_delphi" value="+:gs::delphi"><input type="hidden" name="gs" value="1"><input type="hidden" name="sdn" value="delphi"><input type="hidden" name="tt" value="2"><input type="hidden" name="bts" value="0"><span class="cntnr"><input id="nTxt" type="text" name="email" validate="email" value="Enter email address" validate="email" autoclear="1"></span><button type="submit" name="newsub" class="signup">Sign Up</button></form><h5>By Category</h5><ul id="bcl"><li><a href="/od/beginners/Getting_Started_with_Delphi.htm" zT="18/1hZ/1">Getting Started with Delphi</a></li><li><a href="/od/objectpascalide/Delphi_Language_Inside_and_Out.htm" zT="18/1hZ/2">Coding Delphi Applications</a></li><li><a href="/od/database/Build_Database_Applications_with_Delphi.htm" zT="18/1hZ/3">Build Database Applications</a></li><li><a href="/od/fullcodeprojects/Free_Source_Code_Delphi_Projects.htm" zT="18/1hZ/4">Source Code Projects</a></li><li><a href="/od/vclusing/Understanding_Using_and_Enhancing_Delphi_VCL_Components.htm" zT="18/1hZ/5">Using VCL Components</a></li><li><a href="/od/usedbvcl/Using_Database_Components_DB_Aware_Controls_in_Delphi.htm" zT="18/1hZ/6">Using Data (DB) Controls</a></li><li><a href="/od/windowsshellapi/Advanced_Delphi_Windows_Shell_API_Graphics_OLE_Programming.htm" zT="18/1hZ/7">Advanced Delphi Techniques</a></li><li><a href="/od/internetintranet/Build_Network_Internet_Intranet_Distributed_Delphi_Applications.htm" zT="18/1hZ/8">Coding Internet / Network</a></li><li><a href="/od/delphifornet/Learn_Delphi_8_2005_2006_2007_for_NET.htm" zT="18/1hZ/9">Learn Delphi for .NET</a></li><li><a href="/od/toppicks/Top_Picks_Delphi_Tools_and_Components.htm" zT="18/1hZ/A">Best Components and Tools</a></li><li><a href="/od/devutilities/Essential_Delphi_Tools_Utilities_and_Resources.htm" zT="18/1hZ/B">Essential Tools and Utils</a></li></ul></div></div><script type="text/javascript">splitList(gEI('bcl'));</script><div id="fpromo" class="pane"><h3>More from About.com</h3><ul><li><h4><a href="http://my.about.com/mealplanner" zT="18/1][">Make Meals Easy</a></h4>An easy way to put delicious meals together.</li><li><h4><a href="http://48hoursinvegas.specials.about.com/" zT="18/1][">48 Hours in Vegas</a></h4>Win a weekend getaway in Sin City!</li><li><h4><a href="http://inspiredhome.specials.about.com/" zT="18/1][">Love Your Living Space</a></h4>Achieve your dream home with advice from the pros.</li><li><h4><a href="http://finances.about.com/" zT="18/1][">Financial Planning</a></h4>Stay on top with our smart financial tips.</li></ul><div class="more"><a href="http://azlist.about.com/a.htm" zT="18/1]]"><Strong>Browse All</strong> About.com</a></div></div><script type="text/javascript">prepareTools();zCi();validateForms();</script><div id="abf"><div class="mast"><div class="logo"><a href="http://www.about.com/" zT="18/1Yb/Zv"><img src="http://z.about.com/d/lg/a1.gif" alt="About.com"></a></div><h2><a href="http://delphi.about.com/" zT="18/1Yc/Zx" title="Delphi Programming">Delphi Programming</a></h2><script type="text/javascript">var h2=document.getElementsByTagName("h2")[0];if(h2.getElementsByTagName("a")[0].firstChild.nodeValue.length>28)h2.className="long";</script></div><ol class="crumbtrail"><li class="home"><a href="http://www.about.com/" zT="18/1Yd/Zz">Home</a></li><li><a href="http://www.about.com/compute/">Computing & Technology</a></li><li><a href="http://delphi.about.com/" zT="18/1Yd/Zz">Delphi Programming</a></li><li><a href="http://delphi.about.com/od/fullcodeprojects" zT="18/1Yd/Zz">Source Code Projects</a></li><li><a>Computer Locker - Fancy Delphi Application Contest Entry #47</a></li></ol><div id="lists" class="hlist"><ul><li class="pop"><a href="/popular.htm" zT="18/1YY">Most Popular</a></li><li class="last"><a href="/updated.htm" zT="18/1]c">Latest Articles</a></li></ul></div><div class="subscribe hlist"><h6>Add to: </h6><ul><li><a href="http://fusion.google.com/add?feedurl=http://z.about.com/5/g/delphi/b/index.xml?r=9F" title="Add the Delphi Programming Blog to Google Reader" zT="18/1YZ/cz">iGoogle</a></li><li><a href="http://add.my.yahoo.com/rss?url=http://z.about.com/5/g/delphi/b/index.xml?r=94" title="Add the Delphi Programming Blog to My Yahoo!" zT="18/1YZ/d0">My Yahoo!</a></li><li class="rss last"><a href="/gi/pages/stay.htm#rs" zT="18/1YZ/Zt">RSS</a></li></ul></div></div><div id="aboutinfo" class="hlist"><ul id="siteinfo"><li><a href="http://advertise.about.com/" zT="18/1YX/Zr" rel="nofollow">Advertising Info</a></li><li><a href="http://advertise.about.com/newspress/index.html" zT="18/1YX/Zr" rel="nofollow">News & Events</a></li><li><a href="http://jobs.about.com/" zT="18/1YX/Zr" rel="nofollow">Work at About</a></li><li><a href="http://spiderbites.about.com/sitemap.htm" zT="18/1YX/Zr">SiteMap</a></li><li><a href="http://azlist.about.com/a.htm" zT="18/1]]">All Topics</a></li><li><a href="http://advertise.about.com/contact/printrequests.html" zT="18/1YX/Zr" rel="nofollow">Reprints</a></li><li class="last"><a href="http://delphi.about.com/gi/pages/hc.htm" zT="18/1YX/Zr" rel="nofollow">Help</a></li></ul><ul id="legalinfo"><li><a href="http://www.about.com/gi/pages/uagree.htm" zT="18/1YX/Zr" rel="nofollow">User Agreement</a></li><li><a href="http://www.about.com/gi/pages/ethics.htm" zT="18/1YX/Zr" rel="nofollow">Ethics Policy</a></li><li><a href="http://www.about.com/gi/pages/patent.htm" zT="18/1YX/Zr" rel="nofollow">Patent Info.</a></li><li class="last"><a href="http://www.about.com/gi/pages/mprivacy.htm" zT="18/1YX/Zr" rel="nofollow">Privacy Policy</a></li></ul><ul id="companyinfo"><li><a href="http://ourstory.about.com/" zT="18/1YX/Zr" rel="nofollow">Our Story</a></li><li class="last"><a href="http://beaguide.about.com/" zT="18/1YX/Zr" rel="nofollow">Be a Guide</a></li></ul><div id="disclaimer"><p>©2009 About.com, a part of <a href="http://www.nytco.com/" zT="1/1JK">The New York Times Company</a>.</p><p>All rights reserved.</p></div></div></div><img id="zIpfb" width="1" height="1" border="0" alt=""><script type="text/javascript"><!--adclose()//--></script><script type="text/javascript">var tcdacmd="dt;da";</script><script type="text/javascript" src="http://an.tacoda.net/an/11775/slf.js"></script><img src="http://up.nytimes.com/?d=1/&g=2&h=95EGRM2C20kA1J44&hs=95EGRM2C20kA1J44&t=2&r=http%3a%2f%2fdelphi%2eabout%2ecom%2fod%2ffullcodeprojects%2fFree%5fSource%5fCode%5fDelphi%5fProjects%2ehtm&u=http%3A%2F%2Fdelphi%2eabout%2ecom%2fod%2ffullcodeprojects%2fa%2fcomputer%2dlocker%2ehtm" width="3" height="1" border="0" alt=""></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -