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.

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;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.