Help need to convert this code to C#

Posted by Raj Aththanayake on Stack Overflow See other posts from Stack Overflow or by Raj Aththanayake
Published on 2010-05-25T03:46:40Z Indexed on 2010/05/25 3:51 UTC
Read the original article Hit count: 154

Filed under:
|

I 'm not familiar with VB.NET at all. I need to convert this function to C#. Can anyone please give me a hand?

Public Function GetAppGUID(ByVal sectionId As String) As String

    Dim hexString As String = Nothing
    Dim i As Integer
    Dim guidlen As Integer

    guidlen = 16

    If sectionId.Length < guidlen Then
        sectionId = sectionId & New String(" ".Chars(0), guidlen - sectionId.Length)
    End If

    For i = 1 To guidlen
        hexString = hexString & Hex(Asc(Mid(sectionId, i, 1)))
    Next

    GetAppGUID = hexString

End Function

© Stack Overflow or respective owner

Related posts about c#

Related posts about vb.net