Hi,
I would like to convert the following Visual Basic code to C#, does someone
has free tool to convert it?
Function PreConnect() As Boolean
Dim strDSN$, strUidPwd$, strDatabase$, strConnect$
Dim hFile As Integer, strBuffer As String
' open and read
hFile = FreeFile
Open App.Path & "\" & etcBootFile For Input As hFile
Line Input #hFile, strBuffer
strUidPwd = Decode(strBuffer)
Line Input #hFile, strDSN
Line Input #hFile, strDatabase
Close hFile
' try connect
If strDSN = "" Or strUidPwd = "" Then Exit Function
strConnect = "ODBC;DSN=" & strDSN & ";" & strUidPwd & ";DATABASE=" &
strDatabase
' pre-connect
PreConnect = ConnAttemp(strConnect)
End Function
Function Decode(strWhat$) As String
Decode = Encode(strWhat)
End Function
' 5/23
Function Encode(strWhat$) As String
Dim i As Integer, strResult As String
Dim b As Byte
For i = 1 To Len(strWhat)
b = Asc(Mid(strWhat, i, 1)) Xor etcEncodeKey
strResult = strResult & Chr(b)
Next
Encode = strResult
End Function
Thanks for help.
Jason