Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

VB 2010 StrConv help!

$
0
0
Hello I just joined VBF and just started learning VB. I am creating a simple im client application. Need to encode a string into base64. The problem is that the code I used was for VB6 which contains StrConv function which has been modified in the later versions of VB. Here is the only problem :

Code:

Dim ind As String
            ind = EncodeBase64(StrConv(vbNullChar + username.Text + vbNullChar + pass.Text, vbFromUnicode))

Here is the error:
'vbFromUnicode' is not declared. It may be inaccessible due to its protection level.

Here is the EncodeBase64 function:

Code:

Private Function EncodeBase64(ByRef data() As Byte) As String
        Dim xml As MSXML2.DOMDocument
        Dim node As MSXML2.IXMLDOMElement
        xml = New MSXML2.DOMDocument
        node = xml.createElement("b64")
        node.dataType = "bin.base64"
        node.nodeTypedValue = data
        EncodeBase64 = node.Text
        node = Nothing
        node = Nothing
    End Function

Here is something I found related to the problem but couldn't understand: http://msdn.microsoft.com/en-us/libr...(v=vs.71).aspx

Please treat me as a total newbie and forgive me if I didn't explain good enough. Any suggestions would be highly appreciated. Thank you!

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>