<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Goto 100  - Development with Visual Basic : DevCenter</title><link>http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx</link><description>Tags: DevCenter</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>ClickOnce and Security</title><link>http://blogs.msdn.com/goto100/archive/2009/06/15/clickonce-and-security.aspx</link><pubDate>Mon, 15 Jun 2009 18:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9708321</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9708321.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9708321</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/wh45kb66.aspx"&gt;ClickOnce&lt;/a&gt; deployment is another area where Code Access Security needs to be kept in mind. ClickOnce deployments will often be used to deploy Visual Basic .NET (or hybrid Interop Toolkit) applications from a website or network file share. In these cases, the applications don't get the standard &lt;b&gt;Full Trust&lt;/b&gt; permissions in CAS. Instead they get the more limited&lt;b&gt; Internet Zone&lt;/b&gt; permissions. As a developer, you will need to ensure that your application can run successfully with this permission set. Visual Studio can help out here, so rather than having to mess around with your security policy while you're debugging, Visual Studio can set up a debugging session with the required permissions (look on the Security page of your project properties to see how to configure this behaviour).&lt;/p&gt;  &lt;p&gt;If the set of permissions granted to the Internet Zone aren't sufficient then you have two options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Ask for the additional permissions in the ClickOnce deployment manifest, and rely on the user accepting the elevated permission request during the install.&lt;/li&gt;    &lt;li&gt;Ask your administrator to configure the standard CAS policy on end user machines to permit elevated permission requests from specific publishers. You then use Authenticode to sign the deployment manifest, using the permitted publisher details.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Option 2 is obviously to be preferred, but needs a bit more work to get set up.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9708321" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Introducing code obfuscation</title><link>http://blogs.msdn.com/goto100/archive/2009/06/12/introducing-code-obfuscation.aspx</link><pubDate>Fri, 12 Jun 2009 18:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9708312</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9708312.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9708312</wfw:commentRss><description>&lt;P&gt;If you recall from an earlier post, I said that the main reason for signing an assembly and giving it a strong name was to prevent it being tampered with. For example, many of the assemblies that make up the .NET framework itself are strong-named assemblies that sit in the GAC. If I disassembled one of these, messed around with the IL code, and then reassembled it, I'd have to sign it with &lt;B&gt;my&lt;/B&gt; signature. Running any existing applications that used the assembly I'd changed would now fail, because the signature had changed. That's all great in that it stops anyone tampering with existing, deployed assemblies.&lt;/P&gt;
&lt;P&gt;What may still be a concern is that the IL code is still legible, so that anyone can see how your code works and what it does (provided they spend a bit of time getting familiar with IL code). This raises the issues of intellectual copyright and opens the potential for security breaches as unscrupulous developers can easily look for weaknesses in your application.&lt;/P&gt;
&lt;P&gt;Enter code obfuscation (Dotfuscator on Visual Studio's Tools menu). This utility renders the contents of your assemblies (the IL code), incomprehensible to human readers, but leaving it so that it can still be run by the CLR. This is done by renaming everything in sight, variables, classes, methods etc with meaningless or duplicate names. Obfuscation is an excellent demonstration of how useful good names are to understanding code!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9708312" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Code Access Security in action – calling Unmanaged Code</title><link>http://blogs.msdn.com/goto100/archive/2009/06/11/code-access-security-in-action-calling-unmanaged-code.aspx</link><pubDate>Thu, 11 Jun 2009 18:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9708300</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9708300.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9708300</wfw:commentRss><description>&lt;p&gt;The following is an example of how code access security might affect your code when calling unmanaged code. Unmanaged code is a posh way of saying “It isn’t .NET code, it is the stuff you used to write before .NET” :-) &lt;/p&gt;  &lt;p&gt;In VB6 making a call to a Windows API function wasn't affected by any security settings. Potentially in .NET, an administrator might configure a machine's code access security policy to disallow calls to unmanaged code (such as the Windows API), because this is seen as a security risk. That means that code like this, could fail with a SecurityException, when the API function is invoked:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;Module&lt;/span&gt; Module1&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Main()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        Win32.MessageBox(0, &lt;span class="str"&gt;&amp;quot;Here's a MessageBox&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Platform Invoke Sample&amp;quot;&lt;/span&gt;, 0)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Module&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; Win32&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="kwrd"&gt;Declare&lt;/span&gt; &lt;span class="kwrd"&gt;Auto&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; MessageBox &lt;span class="kwrd"&gt;Lib&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;user32.dll&amp;quot;&lt;/span&gt; ( _&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; hWnd &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; txt &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, _&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; caption &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Type &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) _&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;There's nothing you can do to stop the code failing (other than having a word with the administrator), but you can handle things a bit more gracefully. You can check when your app starts up whether you've got all the permissions you want, and then handle the situation before you hit the problem. This can be done with an attribute (declaratively), so the permissions are checked when an assembly is loaded:&lt;/p&gt;

&lt;p&gt;&amp;lt;Assembly:SecurityPermissionAttribute(SecurityAction.Demand, Flags := SecurityPermissionFlag.UnmanagedCode)&amp;gt;&lt;/p&gt;

&lt;p&gt;You could also perform the check programmatically:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;Try&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; sp &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; SecurityPermission(SecurityPermissionFlag.UnmanagedCode)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Demanding SecurityPermissionFlag.UnmanagedCode&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        sp.Demand()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Demand for SecurityPermissionFlag.UnmanagedCode succeeded.&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Catch&lt;/span&gt; e &lt;span class="kwrd"&gt;As&lt;/span&gt; Exception&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            Console.WriteLine((&lt;span class="str"&gt;&amp;quot;Demand for SecurityPermissionFlag.UnmanagedCode failed: &amp;quot;&lt;/span&gt; &amp;amp; e.Message))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Try&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Either way you can test for the permission before you need to use it.&lt;/p&gt;

&lt;p&gt;The above checks whether you had the necessary permissions to perform an operation (in this case calling unmanaged code) by using Demand. You can also Assert or Deny a permission. &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;b&gt;SecurityAction.Demand
      &lt;br /&gt;&lt;/b&gt;What in fact you're doing here is checking that your assembly has the requested permission, and that any assemblies above you in the call-stack also have that permission.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;SecurityAction.Assert
      &lt;br /&gt;&lt;/b&gt;This is a little bit different. You're still checking that your assembly has the requested permission, but you're also saying to the CLR - &amp;quot;Don't bother about checking further up the call stack&amp;quot;. In effect, you are taking full responsibility for security. This is usually seen as dangerous behaviour, but there are some circumstances where it's useful.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;SecurityAction.Deny
      &lt;br /&gt;&lt;/b&gt;Here you're saying you don't want a permission. Not at first sight much use, because if you don't want to be able to do something, then you won't write any code to try and do it! However, this also switches off the permission for any assemblies that you call (that might have been written by someone else), unless of course they go ahead and do an Assert!&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9708300" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Authenticode and ActiveX controls</title><link>http://blogs.msdn.com/goto100/archive/2009/06/10/authenticode-and-activex-controls.aspx</link><pubDate>Wed, 10 Jun 2009 18:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9708226</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9708226.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9708226</wfw:commentRss><description>&lt;p&gt;For VB6 developers, one area where asymmetric keys and digital signatures cropped up was the requirement to sign downloadable ActiveX controls using Authenticode. The idea was to sign the controls using a digital signature so that the origin of the control could always be established.&lt;/p&gt;  &lt;p&gt;There are a couple of related concepts in .NET that you'll almost certainly come across sooner or later.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Code Access Security&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;With ActiveX controls, the default behaviour of Internet Explorer was to prevent their download unless they had a valid signature. In .NET the CLR applies a security policy to &lt;b&gt;all&lt;/b&gt; loaded code. The CLR evaluates the code and then decides what that code should and should not be able do. So the CLR will look at a particular assembly, see if it has been signed or where it was loaded from etc., and then decide whether that code is allowed to write to the hard disk or open a network connection and so on. All of these policy rules are stored in configuration files, which in previous versions of the framework you could see and edit using a control panel applet. In .NET 3.5 you're expected to edit this configuration using the command line &lt;a href="http://msdn.microsoft.com/en-us/library/cb6t8dtz.aspx"&gt;caspol.exe&lt;/a&gt; tool (unless you install the .NET 2.0 SDK).&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Strong Names&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;.NET also uses the concept of strong named assemblies. At first sight this looks similar to signing a component using Authenticode, in that strong named assemblies are digitally signed. However the digital signature is used for very different reasons. First of all, if you want to place an assembly in the Global Assembly Cache (&lt;a href="http://msdn.microsoft.com/en-us/library/yf1d93sz.aspx"&gt;GAC&lt;/a&gt;) , it must have a strong name. The digital signature makes your assembly unique, even if someone else has installed an assembly with the same name into the GAC. Secondly, a strong name prevents unauthorised tampering with an assembly. So, although someone can disassemble a strong named assembly using &lt;a href="http://msdn.microsoft.com/en-us/library/f7dy01k1.aspx"&gt;Ildasm&lt;/a&gt;, they can't put it back together again with the same signature (unless you've given them your private key!). Any change in the signature is automatically detected by users of the assembly, and the tampering spotted. Strong naming is done with the &lt;a href="http://msdn.microsoft.com/en-us/library/k5b5tt23.aspx"&gt;Sn&lt;/a&gt; tool.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9708226" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Cryptography</title><link>http://blogs.msdn.com/goto100/archive/2009/06/09/cryptography.aspx</link><pubDate>Tue, 09 Jun 2009 17:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9708220</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9708220.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9708220</wfw:commentRss><description>&lt;p&gt;The second big security area in the .NET framework after Authentication and Authorisation is cryptography. Again, the framework contains a lot of powerful functionality, and again there is an &lt;a href="http://msdn.microsoft.com/en-us/library/dd139964.aspx"&gt;application block&lt;/a&gt; that makes it all a bit easier to use.&lt;/p&gt;  &lt;p&gt;The classes and namespaces that deal with cryptography cover three key areas:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Symmetric Key Encryption/Decryption&lt;/li&gt;    &lt;li&gt;Asymmetric Key Encryption/Decryption (Public Key Cryptography)&lt;/li&gt;    &lt;li&gt;Hashing&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I don't want to get bogged down in the detail of these three topics (there's plenty of resources elsewhere on the web for that), but just highlight where, in a VB application, these technologies may be useful.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Symmetric Key Cryptography&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This kind of encryption algorithm uses a single shared key that can be used to both encrypt and decrypt data. These algorithms are also relatively fast. The fundamental weakness of this approach is that both the encrypting and decrypting parties need to know the &lt;b&gt;same&lt;/b&gt; key, and to make sure that no one else has access to the key. The framework includes implementations of a number of well known algorithms of this type such as DES, TripleDES and AES.&lt;/p&gt;  &lt;p&gt;Where this is useful in a VB application is where the application wants to store it's own data securely - perhaps as a file, or a section of a configuration file, or a registry key. A couple of useful classes are ProtectedMemory and ProtectedData which look after all the key management issues for you.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Asymmetric Key Cryptography&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;While these algorithms are slower than the symmetric ones, they don't rely on a single shared key. Instead, they use a pair of keys, on public and one private, where data encrypted with one key can &lt;b&gt;only&lt;/b&gt; be decrypted using the other. These algorithms, as well as providing encryption, also form the basis of digital signatures. &lt;/p&gt;  &lt;p&gt;This approach is appropriate when exchanging data securely between users or systems. The HTTPS protocol is an example of the use of this approach.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Hashing&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You can think of hashing as a one way system, you can encrypt (hash) a piece of data to generate a unique hash code, but you can't work out from a hash code what the original piece of data was. What's the use of this then? An authentication system that verifies passwords is a good example:&lt;/p&gt;  &lt;p&gt;You need to check that a user password is correct when they log on - so you need to keep a record of passwords somewhere and the password needs to be transmitted over the network from the client application for checking. This gives you two security loopholes - passwords stored in a database and passwords flying around on the network. If you store a hash of the password in the database, and the client application sends a hashed version of the password for checking we've avoided both problems! We just need to compare hash values to check if the password is correct.&lt;/p&gt;  &lt;p&gt;The framework includes implementations of a number of hashing algorithms including SHA and MD5.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9708220" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Authentication and Authorisation</title><link>http://blogs.msdn.com/goto100/archive/2009/06/08/authentication-and-authorisation.aspx</link><pubDate>Mon, 08 Jun 2009 17:56:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9708217</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9708217.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9708217</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/goto100/archive/2009/06/08/visual-basic-net-and-security-a-few-posts-are-required.aspx"&gt;As promised&lt;/a&gt;, the first in a series of posts about security relevant to a developer new to .NET (such as a VB6 developer).&lt;/p&gt;  &lt;p&gt;These are what most people will immediately think of when security is discussed.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Authentication       &lt;br /&gt;&lt;/b&gt;This is proving your identity by some means, whether it's knowing your password, having the right swipe card or having your fingerprint checked.&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Authorisation       &lt;br /&gt;&lt;/b&gt;Once a system knows who you are it can apply some rules to decide what you can see or do.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;ASP.NET has a huge amount of built-in support for performing authentication and authorisation (a far cry from the situation with ASP) including a full-blown membership system that simplifies creating a web site that requires registration before you can access certain areas of the site.&lt;/p&gt;  &lt;p&gt;Authentication and authorisation have tended to be less significant when developing desktop based systems because a) it is a more &amp;quot;controlled&amp;quot; environment and b) the desktop OS can be left to handle these issues for you.&lt;/p&gt;  &lt;p&gt;A common scenario where you do need to customise things is where a desktop application needs its own authorisation rules (we can still rely on the OS performing the authentication for us, typically against Active Directory). What we want to do in our application is authorise users using Active Directory (or ADAM) - to minimise the development effort here you should look at the &lt;a href="http://msdn.microsoft.com/en-us/library/dd203121.aspx"&gt;Security Application Block&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;What (or who) is ADAM, some of you are asking? Simply put&amp;#160; &lt;a href="http://www.microsoft.com/windowsserver2003/adam/default.mspx"&gt;Active Directory Application Mode&lt;/a&gt; is a standalone version of Active Directory that you can distribute with your application. Therefore you could have you own authentication database which could also be customised without impacting Active Directory itself.&lt;/p&gt;  &lt;p&gt;While I'm on the subject of application blocks, there are a couple of others that relate to security. There's a Cryptography Application Block which I'll talk about in a later post, but for now I wanted to point out the &lt;a href="http://msdn.microsoft.com/en-us/library/dd139916.aspx"&gt;Logging Application Block&lt;/a&gt;. This is great if you need to record what's going on in your application for troubleshooting, error reporting, or from the security standpoint, auditing.&lt;/p&gt;  &lt;p&gt;Creating log entries from your code is straightforward:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;Dim&lt;/span&gt; logEntry &lt;span class="kwrd"&gt;As&lt;/span&gt; LogEntry = &lt;span class="kwrd"&gt;New&lt;/span&gt; LogEntry()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;logEntry.EventId = 100&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;logEntry.Priority = 2&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;logEntry.Message = &lt;span class="str"&gt;&amp;quot;User Logon: &amp;quot;&lt;/span&gt; + userName&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;logEntry.Categories.Add(&lt;span class="str"&gt;&amp;quot;Audit&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;logEntry.Categories.Add(&lt;span class="str"&gt;&amp;quot;UI Events&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;Logger.Write(logEntry)&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The configuration options of the application block then enable you to control things like where the log messages get written to, and to define filters based on LogEntry fields. &lt;/p&gt;

&lt;p&gt;Possible destinations for log messages include: a database, the Windows Event Log, a rolling flat file or an email.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9708217" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Virtualization and Visual Basic 6.0 applications</title><link>http://blogs.msdn.com/goto100/archive/2009/06/07/virtualization-and-visual-basic-6-0-applications.aspx</link><pubDate>Sun, 07 Jun 2009 19:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9701573</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9701573.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9701573</wfw:commentRss><description>&lt;P&gt;There may be some circumstances where upgrading a VB6 application is not feasible, for example it may rely on a control that simply does not work in the target operating system. I came across a couple of articles on MSDN that discussed the ways that virtualisation technologies can be applied to this problem. There are three basic approaches:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Run all, or in a virtual machine. Virtual PC, Virtual Server or Hyper-V in Windows Server 2008 are all possibilities.&lt;/LI&gt;
&lt;LI&gt;Use Terminal Services to give end users access to the application.&lt;/LI&gt;
&lt;LI&gt;Use Microsoft Application Virtualization (formally Softgrid) to virtualize a part of the application.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Check out these links:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-gb/library/cc522935.aspx" mce_href="http://msdn.microsoft.com/en-gb/library/cc522935.aspx"&gt;Using Virtualization to Preserve a Visual Basic 6.0 Client-Server Application&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-gb/library/cc526339.aspx" mce_href="http://msdn.microsoft.com/en-gb/library/cc526339.aspx"&gt;Visual Basic 6.0 Application Availability with Microsoft Virtualization&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/systemcenter/appv/default.mspx" mce_href="http://www.microsoft.com/systemcenter/appv/default.mspx"&gt;Microsoft Application Virtualization&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9701573" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Aberdeen Group report on Migrating from VB6 to .NET</title><link>http://blogs.msdn.com/goto100/archive/2009/06/05/aberdeen-group-report-on-migrating-from-vb6-to-net.aspx</link><pubDate>Fri, 05 Jun 2009 18:50:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9701501</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9701501.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9701501</wfw:commentRss><description>&lt;p&gt;Aberdeen Group have created a new report “&lt;a href="http://www.aberdeen.com/launch/report/perspective/6084-AI-visual-basic-software.asp"&gt;Migrating from VB6 to .NET: The challenge of software agility in a volatile economy&lt;/a&gt;”&lt;/p&gt;  &lt;p&gt;Some bits that stood out for me:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;50% will migrate all the applications, 36% will migrate some (86% in total will migrate)&lt;/li&gt;    &lt;li&gt;“Best in class” understand the importance of external migration services and tools - 30%+ in each category&lt;/li&gt;    &lt;li&gt;14% of organisations said their &lt;strong&gt;entire environment&lt;/strong&gt; is VB6 based.&lt;/li&gt;    &lt;li&gt;For those who will NOT migrate to VB.NET:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;62% will migrate to C#&lt;/li&gt;      &lt;li&gt;10% Other .NET languages&lt;/li&gt;      &lt;li&gt;16% Java (tut tut)&lt;/li&gt;      &lt;li&gt;12% Other none .NET&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9701501" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Migration/default.aspx">Migration</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Visual Basic 6.0 Migration – due diligence is a good thing</title><link>http://blogs.msdn.com/goto100/archive/2009/06/05/visual-basic-6-0-migration-due-diligence-is-a-good-thing.aspx</link><pubDate>Fri, 05 Jun 2009 18:35:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9701484</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9701484.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9701484</wfw:commentRss><description>&lt;p&gt;Choice in general is a good thing. When faced with moving a Visual Basic 6.0 application to .NET there is plenty of choices to be made. One of those choices is “Which tool should I go with to migrate the code?”. &lt;/p&gt;  &lt;p&gt;My advice in general is “Try as many as you can on a representative chunk of your application”.&lt;/p&gt;  &lt;p&gt;I spotted over on the VB Migration Partner website &lt;a href="http://www.vbmigration.com/casestudies/sis.aspx"&gt;a case study&lt;/a&gt; which contained an example of just that:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“During the software evaluation phase SIS run a 25K prototype through all the conversion programs. &lt;b&gt;It took 2.5 hours to get a compilable and runnable VB.NET project with VB Migration Partner, and 13 hours with its closest competitor.&lt;/b&gt; The reduced effort, the ability to use pragmas and support for the convert-test-fix were the main reasons for choosing Code Architects’ software.”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This was a 650K Lines of Code conversion in just 6 months with a total effort of 18 man-months. Pretty impressive. &lt;/p&gt;  &lt;p&gt;P.S. 13/2.5 = 5 times faster, in case you were wondering :-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9701484" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Migration/default.aspx">Migration</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Support statement for Visual Basic 6.0 updated for Windows 7</title><link>http://blogs.msdn.com/goto100/archive/2009/02/26/support-statement-for-visual-basic-6-0-updated-for-windows-7.aspx</link><pubDate>Fri, 27 Feb 2009 02:20:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9447620</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9447620.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9447620</wfw:commentRss><description>&lt;p&gt;I have been asked many times in the last few weeks about Windows 7 and VB6. The support statement &lt;a href="http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx" target="_blank"&gt;has been updated to cover Windows 7&lt;/a&gt; and the news is good.&lt;/p&gt;  &lt;blockquote&gt;   &lt;h3&gt;Windows 7&lt;/h3&gt;    &lt;p&gt;Since the initial release of this support statement, the Windows 7 operating system has been announced.&amp;#160; This document has been updated to clarify Microsoft’s support for VB6 on Windows 7.&lt;/p&gt;    &lt;p&gt;VB6 runtime will ship and will be supported in Windows 7 for the lifetime of the OS.&amp;#160; Developers can think of the support story for Vista being the same as it is for Windows 7.&amp;#160; However there are no plans to include VB6 runtime in future versions of Windows beyond Windows 7.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9447620" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Results of Visual Basic Survey (UK)</title><link>http://blogs.msdn.com/goto100/archive/2009/02/17/results-of-visual-basic-survey-uk.aspx</link><pubDate>Tue, 17 Feb 2009 23:49:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9428535</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9428535.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9428535</wfw:commentRss><description>&lt;p&gt;In January we created a survey to understand how folks were using Visual Basic 6.0 and Visual Basic .NET in the UK. This survey was sent out to individuals we “suspected” had Visual Basic 6.0 heritage but it was also widely advertised through the UK MSDN &lt;a href="http://msdn.microsoft.com/en-gb/flash/default.aspx"&gt;Flash&lt;/a&gt; to UK developers. &lt;/p&gt;  &lt;p&gt;We got plenty of great data and I wanted to share the interesting bits more widely as I think as developers we are always curious about what our peers are up to. Well, I am :-)&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://geekswithblogs.net/iupdateable/archive/2009/02/17/results-of-the-visual-basic-survey-part-1-language-and.aspx"&gt;Part 1 – Language and Framework Usage&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://geekswithblogs.net/iupdateable/archive/2009/02/18/results-of-the-visual-basic-survey-part-2-visual-basic.aspx"&gt;Part 2 – Visual Basic 6.0 Usage Today&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://geekswithblogs.net/iupdateable/archive/2009/02/17/results-of-the-visual-basic-survey-part-3-move-from.aspx"&gt;Part 3 – Move from Visual Basic 6.0 to .NET&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9428535" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/UK/default.aspx">UK</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Visual Basic Upgrade Wizard vs 3rd Party Migration Tools</title><link>http://blogs.msdn.com/goto100/archive/2009/02/05/visual-basic-upgrade-wizard-vs-3rd-party-migration-tools.aspx</link><pubDate>Thu, 05 Feb 2009 18:45:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9398858</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9398858.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9398858</wfw:commentRss><description>&lt;p&gt;[If you are UK based, check out &lt;a href="http://www.microsoft.com/uk/vbmigration"&gt;www.microsoft.com/uk/vbmigration&lt;/a&gt; for more information ]&lt;/p&gt;  &lt;p&gt;A question I get asked a lot is “Are 3rd party migration tools really that much better than the free upgrade wizard from Microsoft?” &lt;/p&gt;  &lt;p&gt;Lets me be perfectly candid. Whilst I always recommend people should try the free wizard first, it has many shortcomings. Too many IMHO. That said, for some folks it will be perfectly “good enough” to enable a successful migration from VB6 to Visual Basic .NET. However for large, complex VB6 applications you would likely be much better served by a 3rd party tool.&lt;/p&gt;  &lt;p&gt;The two main companies in this space have each created a comparison with the Upgrade Wizard which I would definitely recommend you check out.&lt;/p&gt;  &lt;h2&gt;Code Architects VB Migration Partner&lt;/h2&gt;  &lt;p&gt;Code Architects have a &lt;a href="http://www.vbmigration.com/whitepapers/comparisonwithupgradewizard.aspx"&gt;paper which includes a detailed analysis&lt;/a&gt; of the output of their VB Migration Partner compared with the Upgrade Wizard on a number of Open SourceVB6 projects and a look at how well each tool handles compatibility issues as identified by &lt;strong&gt;&lt;a href="http://www.aivosto.com/project/project.html"&gt;VB Project Analyzer&lt;/a&gt;&lt;/strong&gt; from Aivosto. VB Migration Partner was:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;About four times faster &lt;/li&gt;    &lt;li&gt;Produced fives times fewer compilation errors in the final .NET code &lt;/li&gt;    &lt;li&gt;Able to fully or partially handle 43 of the 49 compatibility issues that are left unresolved by the Upgrade Wizard &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/goto100/WindowsLiveWriter/VisualBasicUpgradeWizardvs3rdPartyMigrat_DD98/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="480" alt="image" src="http://blogs.msdn.com/blogfiles/goto100/WindowsLiveWriter/VisualBasicUpgradeWizardvs3rdPartyMigrat_DD98/image_thumb_1.png" width="573" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;Artinsoft Visual Basic Upgrade Companion&lt;/h2&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Artinsoft have created a &lt;a href="http://www.artinsoft.com/visual-basic-upgrade-companion-vs-upgrade-wizard.aspx"&gt;detailed whitepaper&lt;/a&gt; looking at the &lt;strong&gt;many differences&lt;/strong&gt; between the Wizard and their Visual Basic Upgrade Companion. They are sometimes very big differences – such as how the tool handles 3rd party controls. The paper also includes &lt;strong&gt;lots&lt;/strong&gt; of great code snippets which allow you to directly compare the two tools.&lt;/p&gt;  &lt;p&gt;e.g. Error Handling&lt;/p&gt;  &lt;p&gt;Original VB6 Source Code:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ErrorHandling(arg1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) 
&lt;span class="kwrd"&gt;On&lt;/span&gt; &lt;span class="kwrd"&gt;Error&lt;/span&gt; &lt;span class="kwrd"&gt;GoTo&lt;/span&gt; ErrorHandler 
    &lt;span class="kwrd"&gt;Dim&lt;/span&gt; var1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; 
    var1 = 1 / arg1 
    MsgBox var1 
    MsgBox arg1 
    &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; 
ErrorHandler: 
    MsgBox Err.Description, , &lt;span class="str"&gt;&amp;quot;Error&amp;quot;&lt;/span&gt; 
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The Upgrade Wizard:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ErrorHandling(&lt;span class="kwrd"&gt;ByRef&lt;/span&gt; arg1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Short&lt;/span&gt;) 
&lt;span class="kwrd"&gt;On&lt;/span&gt; &lt;span class="kwrd"&gt;Error&lt;/span&gt; &lt;span class="kwrd"&gt;GoTo&lt;/span&gt; ErrorHandler 
  &lt;span class="kwrd"&gt;Dim&lt;/span&gt; var1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Short&lt;/span&gt; 
  var1 = 1 / arg1 
  MsgBox(var1) 
  MsgBox(arg1) 
  &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; 
ErrorHandler:  
  MsgBox(Err.Description,  , &lt;span class="str"&gt;&amp;quot;Error&amp;quot;&lt;/span&gt;) 
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;
  &lt;br /&gt;But the Visual Basic Upgrade Companion uses Try/Catch:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ErrorHandling(&lt;span class="kwrd"&gt;ByRef&lt;/span&gt; arg1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;) 
&lt;span class="kwrd"&gt;Try&lt;/span&gt;  
  &lt;span class="kwrd"&gt;Dim&lt;/span&gt; var1 &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; 
  var1 = 1 / arg1 
  MessageBox.Show(&lt;span class="kwrd"&gt;CStr&lt;/span&gt;(var1), Application.ProductName) 
  MessageBox.Show(&lt;span class="kwrd"&gt;CStr&lt;/span&gt;(arg1), Application.ProductName)  
  15 
&lt;span class="kwrd"&gt;Catch&lt;/span&gt; excep &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Exception       
  MessageBox.Show(excep.Message, &lt;span class="str"&gt;&amp;quot;Error&amp;quot;&lt;/span&gt;) 
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Try&lt;/span&gt; 
&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Do check out the paper, especially the many code samples.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9398858" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Migration/default.aspx">Migration</category><category domain="http://blogs.msdn.com/goto100/archive/tags/UK/default.aspx">UK</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>A mocking framework especially designed for Visual Basic .NET</title><link>http://blogs.msdn.com/goto100/archive/2009/02/05/a-mocking-framework-especially-designed-for-visual-basic-net.aspx</link><pubDate>Thu, 05 Feb 2009 16:58:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9398533</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9398533.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9398533</wfw:commentRss><description>&lt;p&gt;I was pleased to see the Typemock folks have delivered a special &lt;a href="http://www.typemock.com/vbpage.php"&gt;VB.NET API to use Typemock 5.2&lt;/a&gt; for unit testing. This handles the differences in VB9 vs C# 3.0 around Lambdas (VB9 is restricted to functions where as C# 3.0 can handle statement lambdas – this will be resolved in VB10 aka Visual Basic 2010).&lt;/p&gt;  &lt;p&gt;There are three related blog posts which did into this:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blog.typemock.com/2009/01/isolator-new-vbnet-friendly-api.html"&gt;Overview&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Isolator&amp;#39;s VB API - Creating Fakes" href="http://blog.typemock.com/2009/01/isolator-vb-api-creating-fakes.html"&gt;Isolator's VB API - Creating Fakes&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Isolator&amp;#39;s VB API - Setting Behavior and Assertion" href="http://blog.typemock.com/2009/01/isolator-vb-api-setting-behavior-and.html"&gt;Isolator's VB API - Setting Behavior and Assertion&lt;/a&gt;&amp;#160;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I am keen to dig into mocking some more over the next couple of months. Typemock is one such tool but I also need to (minimally) check out &lt;a href="http://ayende.com/projects/rhino-mocks.aspx"&gt;Rhino.Mocks&lt;/a&gt; and &lt;a href="http://code.google.com/p/moq/"&gt;Moq&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;You might also want to check out these short screencasts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.typemock.com/Multimedia.html#identifier1"&gt;Introduction to TypeMock&lt;/a&gt; (One of a series)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.dimecasts.net/Casts/CastDetails/12"&gt;Mocking with Rhino.Mocks&lt;/a&gt; (There are a couple of others also on dimecasts)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.dimecasts.net/Casts/CastDetails/8"&gt;Mocking with Moq&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9398533" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+2008/default.aspx">Visual Basic 2008</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>New article on extending VB6.0 applications with the Interop Forms Toolkit 2.0</title><link>http://blogs.msdn.com/goto100/archive/2009/02/05/new-article-on-extending-vb6-0-applications-with-the-interop-forms-toolkit-2-0.aspx</link><pubDate>Thu, 05 Feb 2009 16:24:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9398438</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9398438.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9398438</wfw:commentRss><description>&lt;p&gt;I just wanted to swiftly share some useful links if you choose to extend a Visual Basic 6.0 application including a new article I commissioned in the UK – which turned out rather good.&lt;/p&gt;  &lt;p&gt;Firstly links to the toolkit download and some of the best existing articles.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The &lt;a href="http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx"&gt;Interop Forms Toolkit 2.0&lt;/a&gt; which you need to download&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/vb-interop/VB6InteropToolkit2.aspx"&gt;Interop Forms Toolkit 2.0 Tutorial&lt;/a&gt; on Code Project which includes an example of using a WPF control inside a Windows Form as part of a Visual Basic 6.0 application&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogs.foxite.com/bernardbout/archive/2007/06/20/4126.aspx"&gt;Using the Toolkit with Visual Foxpro&lt;/a&gt; – yep, you can use the toolkit with VFP9&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/VB6_-_C__Interop_Form.aspx"&gt;Using C# with the Interop Forms Toolkit&lt;/a&gt; and useful &lt;a href="http://blogs.msdn.com/vbteam/archive/2007/06/01/so-what-does-lt-comclass-gt-actually-do.aspx"&gt;blog post from the team&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Which leads me to the &lt;a href="http://download.microsoft.com/documents/uk/msdn/vb6/Interop_Toolkit_Whitepaper.pdf"&gt;new article&lt;/a&gt; on using the Interop Forms Toolkit. This is a detailed, code heavy look at using the Interop Forms Toolkit which we are getting some great feedback on.&lt;/p&gt;  &lt;p&gt;It covers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Installation and setup&lt;/li&gt;    &lt;li&gt;Interop Forms&lt;/li&gt;    &lt;li&gt;Interop UserControls&lt;/li&gt;    &lt;li&gt;Sharing data between managed and unmanaged code&lt;/li&gt;    &lt;li&gt;Debugging&lt;/li&gt;    &lt;li&gt;Deployment&lt;/li&gt;    &lt;li&gt;And recommendations on using it&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Enjoy.&lt;/p&gt;  &lt;p&gt;P.S.&amp;#160; I must admit I have never liked the name of this kit as it doesn’t really describe what it does - IMHO. I therefore often describe it as &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;The Add VB.NET Forms and Controls to your VB6 Application Toolkit&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;However that does it a disservice. It is broader than that. How about &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;The Add VB.NET or C# Forms and Controls to your VB6 Application Toolkit&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Or even more descriptively&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;The Add VB.NET or C# Forms and Controls to your VB6 or VFP9 Application Toolkit&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Or&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;The Add .NET Forms and Controls written in any .NET language to any COM based Application but it is much easier to use for VB6 and VB.NET Toolkit &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Ok I give in, Interop Forms Toolkit 2.0 it is :-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9398438" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/goto100/archive/tags/UK/default.aspx">UK</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+2008/default.aspx">Visual Basic 2008</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+2005/default.aspx">Visual Basic 2005</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item><item><title>Secure your Visual Basic 6.0 investment with Microsoft .NET</title><link>http://blogs.msdn.com/goto100/archive/2009/01/28/secure-your-visual-basic-6-0-investment-with-microsoft-net.aspx</link><pubDate>Wed, 28 Jan 2009 23:36:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9381745</guid><dc:creator>Eric Nelson</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/goto100/comments/9381745.aspx</comments><wfw:commentRss>http://blogs.msdn.com/goto100/commentrss.aspx?PostID=9381745</wfw:commentRss><description>&lt;p&gt;[This is currently a UK only initiative but you will still find a lot of useful information on the new site and I know our partners are happy to engage worldwide]&lt;/p&gt;  &lt;p&gt;Over the last couple of months I have been working with Sarah in my group to pull together something which hopefully will help the many companies in the UK who continue to have a significant investment in Visual Basic 6.0&amp;#160; - and we did it with virtually no budget thanks to some great help and encouragement from &lt;a href="http://www.artinsoft.com/"&gt;Artinsoft&lt;/a&gt;, &lt;a href="http://www.vbmigration.com/"&gt;Code Architects&lt;/a&gt; and Avanade. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-gb/dd408373.aspx"&gt;Check out what we created&lt;/a&gt; if you are based in the United Kingdom and still have Visual Basic 6.0 applications running your company. Some of the highlights:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A great prize draw to win a free copy of a migration tool from Artinsoft or Code Architects (We have several to give away) &lt;/li&gt;    &lt;li&gt;Great offers from our partners. How about a entry level great migration tool for just £199 or 25% off a full blown enterprise class tool &lt;/li&gt;    &lt;li&gt;An attempt to summarise the five options you can take along with a 10 minute screencast by myself explaining the five options (and you can tell I had a cold when I recorded it!) &lt;/li&gt;    &lt;li&gt;Links to the best resources to find out more &lt;/li&gt;    &lt;li&gt;And a a brand new detailed article on the Interop Forms Toolkit which enables .NET forms and controls to be easily mixed with Visual Basic 6.0 forms and controls. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;P.S. The web page does have one or two “bugs” – but we will get them fixed on the next refresh.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9381745" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+6/default.aspx">Visual Basic 6</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+.NET/default.aspx">Visual Basic .NET</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Migration/default.aspx">Migration</category><category domain="http://blogs.msdn.com/goto100/archive/tags/UK/default.aspx">UK</category><category domain="http://blogs.msdn.com/goto100/archive/tags/Visual+Basic+2008/default.aspx">Visual Basic 2008</category><category domain="http://blogs.msdn.com/goto100/archive/tags/DevCenter/default.aspx">DevCenter</category></item></channel></rss>