954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Completely Lost

I Have Been Trying For Days To Convert This VB.Net Code into CSharp With *NO* Success.

Private Function CharHash(ByVal Data As String) As String
        Dim Temp As String = Nothing
        Dim Result As String = Nothing
        ''
        Dim i As Int64
        ''
        For i = 1 To Len(Data) Step 2
            Temp = Chr(Val("&H" & Mid(Data, i, 2)))
            Result = Result & Temp
        Next
        ''
        Return Result
    End Function


I Have Tried Everything I Can, But My Knowledge of C# is Lacking.
Any Conversions Would Be Very Greatly Appreciated.

gh0sts416
Newbie Poster
5 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

try this :

private string CharHash(string Data)
{
	string Temp = null;
	string Result = null;
	//'
	long i;
	//'
	for (i = 1; i <= Data.Length; i += 2)
	{
		Temp = System.Convert.ToString(Strings.Chr((int) (Conversion.Val("&H" + Data.Substring((int) (i - 1), 2)))));
		Result = Result + Temp;
	}
	//'
	return Result;
}
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You