我是用一个
BitArray ba=new BitArray[256];
来存储用户的权限(每一位控制一个功能),然后把它转化成字符串存放在数据库里:
Byte[] bt=new Byte[32];
ba.Copyto(bt,0);
string str=BitConvertoer.Tostring(str);但是不知道怎么把他转化回来,请大虾帮帮我,,,,,,
BitArray ba=new BitArray[256];
来存储用户的权限(每一位控制一个功能),然后把它转化成字符串存放在数据库里:
Byte[] bt=new Byte[32];
ba.Copyto(bt,0);
string str=BitConvertoer.Tostring(str);但是不知道怎么把他转化回来,请大虾帮帮我,,,,,,
system.text.encoding.defaults.getbyte(yourstring)
相反的
system.text.encoding.defaults.getstring(yourbytes)