Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no equivalent in VB.NET that I could find. For this piece of code you are probably going to want to open it in Reflector and change the output type to VB to get the exact copy of the code that you need. For instance when I put the following in to Reflector:</p> <pre><code>switch (args[0]) { case "UserID": Console.Write("UserID"); break; case "PackageID": Console.Write("PackageID"); break; case "MVRType": if (args[1] == "None") Console.Write("None"); else goto default; break; default: Console.Write("Default"); break; } </code></pre> <p>it gave me the following VB.NET output.</p> <pre><code>Dim CS$4$0000 As String = args(0) If (Not CS$4$0000 Is Nothing) Then If (CS$4$0000 = "UserID") Then Console.Write("UserID") Return End If If (CS$4$0000 = "PackageID") Then Console.Write("PackageID") Return End If If ((CS$4$0000 = "MVRType") AndAlso (args(1) = "None")) Then Console.Write("None") Return End If End If Console.Write("Default") </code></pre> <p>As you can see you can accomplish the same switch case statement with If statements. Usually I don't recommend this because it makes it harder to understand, but VB.NET doesn't seem to support the same functionality, and using Reflector might be the best way to get the code you need to get it working with out a lot of pain.</p> <p><strong>Update:</strong></p> <p>Just confirmed you cannot do the exact same thing in VB.NET, but it does support some other useful things. Looks like the IF statement conversion is your best bet, or maybe some refactoring. Here is the definition for Select...Case</p> <p><a href="http://msdn.microsoft.com/en-us/library/cy37t14y.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/cy37t14y.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload