Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Converting VB6 Code to C#

Status
Not open for further replies.

ChewDoggie

Programmer
Mar 14, 2005
604
US
Hello All,

I have the following VB6 code Function that I'm converting to C#:

Code:
Public Function ConvertString(SentString As String) As String
    Dim i As Integer
    Dim ckSum As Long
    Dim bytSum As Byte
    
    ckSum = 0
    On Error Resume Next
    For i = 1 To Len(SentString)         ' compute the sum
        ckSum = ckSum + Asc(Mid(SentString, i, 1))
    Next i
    bytSum = ckSum Mod 256      ' convert to a byte
    bytSum = Not bytSum         ' take one's complement
    ConvertString = SentString & BinaryToHex(bytSum) ' Convert Byte to Hex
End Function

the line that says

Code:
bytSum = Not bytSum

How do recreate this line in c# ?

Chew

10% of your life is what happens to you. 90% of your life is how you deal with it.
 
I think I'm, like, the most out of touch programmer that ever existed.

YES.....Google IS my friend (and lately, you have been too).

Thanks for the clever link !

C.

10% of your life is what happens to you. 90% of your life is how you deal with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top