ANSI转换
浪费了我一个早上时间,转换字符串到ANSI码,这里记录一下,以后不用再试了.其中包括了中文及回车换行等
string temp = “字符串“
string jsript;
int num;
char tempchar;
for(int i=0;i<temp.Length;i++)
{
tempchar = Convert.ToChar(temp.Substring(i,1));
num = Convert.ToInt32(tempchar);
jsript = "<script language='javascript'>alert(\""+num.ToString()+"\");</script>";
Page.RegisterClientScriptBlock("select"+i.ToString(),jsript);
}
string temp = “字符串“
string jsript;
int num;
char tempchar;
for(int i=0;i<temp.Length;i++)
{
tempchar = Convert.ToChar(temp.Substring(i,1));
num = Convert.ToInt32(tempchar);
jsript = "<script language='javascript'>alert(\""+num.ToString()+"\");</script>";
Page.RegisterClientScriptBlock("select"+i.ToString(),jsript);
}