Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this:</p> <p><strong><a href="http://www.developerfusion.com/tools/convert/vb-to-csharp/?batchId=b5aad756-1a62-4476-b4f4-264e98b31492" rel="nofollow noreferrer">VB.Net to C# Conversion</a></strong></p> <pre><code>public string DecryptString(string EncryptedString) { string functionReturnValue = null; string TempLine = null; string TempChar = null; string FinalStr = null; int i = 0; int value = 0; FinalStr = null; value = 0; if (!string.IsNullOrEmpty(EncryptedString)) { for (i = 1; i &lt;= Strings.Len(EncryptedString); i++) { try { TempChar = Strings.Mid(EncryptedString, i, 1); value = Strings.Asc(TempChar); value = (value - (120)); FinalStr = FinalStr + Strings.Chr(value); } catch { functionReturnValue = ""; return functionReturnValue; } } functionReturnValue = FinalStr; return functionReturnValue; } functionReturnValue = ""; return functionReturnValue; } </code></pre> <p><strong>Refer:</strong></p> <p>1.) <strong><a href="http://msdn.microsoft.com/en-us/library/78sb8546.aspx" rel="nofollow noreferrer">Strings.Asc Method (String)</a></strong> :Returns an Integer value representing the character code corresponding to a character. (Namespace: Microsoft.VisualBasic)</p> <p>2.) <strong><a href="https://stackoverflow.com/questions/721201/whats-the-equivalent-of-vbs-asc-and-chr-functions-in-c">What's the equivalent of VB's Asc() and Chr() functions in C#?</a></strong>:</p> <p>For Asc() you can cast the char to an int like this:</p> <pre><code>int i = (int)your_char; </code></pre> <p>and for Chr() you can cast back to a char from an int like this:</p> <pre><code>char c = (char)your_int; </code></pre>
    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