C# byte[]与string的转换
在vb.net中把string转化成byte数组
dim StrFtpUpdateIniDest as string ="C:\AVM\PlayList\New\"
Dim sms() As Byte=System.Text.Encoding.default.getbytes(StrFtpUpdateIniDest)
1、
System.Text.UnicodeEncoding converter = new System.Text.UnicodeEncoding();
byte[] inputBytes =converter.GetBytes(inputString);
string inputString = converter.GetString(inputBytes);
2、
string inputString = System.Convert.ToBase64String(inputBytes);
byte[] inputBytes = System.Convert.FromBase64String(inputString);
1、
System.Text.UnicodeEncoding converter = new System.Text.UnicodeEncoding();
byte[] inputBytes =converter.GetBytes(inputString);
string inputString = converter.GetString(inputBytes);
2、
string inputString = System.Convert.ToBase64String(inputBytes);
byte[] inputBytes = System.Convert.FromBase64String(inputString);
![](http://www.cnblogs.com/images/cnblogs_com/xsmhero/20091027.jpg)