FileStream fs = new FileStream("c:\aa", FileMode.Create, FileAccess.Write);
fs.Write(System.Text.Encoding.Default.GetBytes("column1"), 0, 4);
fs.Write(System.Text.Encoding.Default.GetBytes("column2"), 0, 4);
fs.Write(System.Text.Encoding.Default.GetBytes("column3"), 0, 4);
byte[] byTemp = File.ReadAllBytes("c:\aa");
//怎么能将正文column1赋值给变量str?
string str = "column1";//??????????????????????????
string str = System.Text.Encoding.Default.GetString ( byTemp );
可以把bytes[] 转换成字符串,再赋值
byte[] buffer = new byte[10];
String str = System.Text.Encoding.Default.GetString(buffer);
new String(byte)
把数组字节byte[ ]当作String的参数,再进行值的传递
使用string的自身的构造方法 可以将byte【】当作参数传进去string a=new string(byte【】 m)