devxlogo

Tip Bank

Store XML in C++ Source Code

XMLwhen it is in ASCIIcan be stored as any other literal in one line, but it’s not very readable. Use the following macros to store XML (or any other string

A Better Way to Stop an IP Address From Accessing Your Site

A more elegant approach: use an associative array. If you have more addresses to block, put them together (in this example, using CGI and Perl): #!perlmy %block_ip=(‘172.56.260.71’=>’bad.org’,’172.56.260.72’=>’evil.org’,);my $remote = $ENV{REMOTE_ADDR}

ClearRunHistory – Clearing the Run history

‘ Clear the Run History’ The MRU list is kept available until Explorer is restartedSub ClearRunHistory() Dim keyName As String = “SoftwareMicrosoftWindowsCurrentVersionExplorer” _ & “RunMRU” ‘ delete the key that

ClearIEHistory – Clearing the Internet Explorer’s history

‘ Clear the IE’s HistorySub ClearIEHistory() Dim keyName As String = “SoftwareMicrosoftInternet ExplorerTypedURLs” ‘ delete the key that contains the URLs the history Microsoft.Win32.Registry.CurrentUser.DeleteSubKey(keyName, False) ‘ recreate the key, empty