473,884 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Encode a string using Base64

Hello friends

I'm creating one application that will send content to another app using
HTTP connection. To authenticate my connection, I need to send a string with
the username and password encoded using Base64.

Dim username as String
Dim pass as String
Dim info_user as String
info_user = username + ":" + pass

and I need to encode info_user String using Base64. Can anyone help me how
can I do this, because I'm not sure how to do this.

Thanks for Help

Nov 21 '05 #1
2 3902
"Bruno" <Br***@discussi ons.microsoft.c om> schrieb:
and I need to encode info_user String using Base64.

You can use 'Convert.ToBase 64String' to get a Base64-string.

M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Try this example:


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Ramy076 | last post by:
I have a C App which uses openssl for Encoding and decoding which needs to be ported to java. The decoded text does not match between the C App and the java App. The size of the output itself is wrong. I think i am doing something basically wrong. pls help. Output is not the same as seen here because of special characters Output from C: is only 12 bytes long
by: Schneider Alexander | last post by:
Hello, I would to encode and respectively to decode string's. Now ist my question: Is there a Funktion into J2SE 1.4 API? Thanks Alexander Schneider
by: Elmo Mäntynen | last post by:
I want to encode a plaindigest or a hexdigest in base 32. Any hints? Elmo
by: Damir Hakimov | last post by:
Hi *! I found a strange bug in base64.encode and decode, when I try to encode - decode a file 1728512 bytes lenth. Is somebody meet with this? I don't attach the file because it big, but can send to private. Which solution for transfer file (binary data) via string-only object? Damir.
by: Curt Fluegel | last post by:
I seem to be having a problem base64 encoding characters above 127. I can encode a sentence like "The big bad dog" without problems, but if I try to encode something like 0xFF I get different results than in Perl. For example I am using: byte binaryArray = System.Text.ASCIIEncoding.ASCII.GetBytes(binaryString); string pushString = System.Convert.ToBase64String(binaryArray);
by: Philip Wagenaar | last post by:
I want to mime encode a string. I think that mime is base64 coding (is this true?). I created the following code: Dim oEncoder As New System.Text.ASCIIEncoding Dim Str As String = "SYSTEM" Dim bytes As Byte() = oEncoder.GetBytes(Str) Convert.ToBase64String(bytes, 0, bytes.Length) MsgBox(Encoding.ASCII.GetString(bytes)
by: jtfaulk | last post by:
I need to encode some information on the server side using ASP.NET with C#; sending via HTTP to a client side application, that needs to be decoded in an MFC C++ application. I'm not sure if I can encode something using: C#: System.Security.Cryptography (to encode) and
by: robert | last post by:
want to encode/decode an arbitrary short 8-bit string as save filename. is there a good already builtin encoding to do this (without too much inflation) ? or re.sub expression? or which characters are not allowed in filenames on typical OS? robert
by: Russell Warren | last post by:
I've got a case where I want to convert binary blocks of data (various ctypes objects) to base64 strings. The conversion calls in the base64 module expect strings as input, so right now I'm converting the binary blocks to strings first, then converting the resulting string to base64. This seems highly inefficient and I'd like to just go straight from binary to a base64 string. Here is the conversion we're using from object to...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.