http://blog.csdn.net/net_lover/archive/2004/07/06/35228.aspx
http://community.csdn.net/Expert/topic/3330/3330368.xml?temp=.4426081
int d=10;
int x=Convert.ToInt32(d.ToString("x"),16); //把16进制的字符串变回10进制的.
Response.Write(d.ToString("x") + "<br>");
Response.Write(x + "<br>");
Response.Write(Convert.ToInt32(0xA));
Response.Write(EncodingSMS("AB测试C"));
http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/cpref/html/frlrfSystemNetHttpWebRequestClassTopic.asp
http://community.csdn.net/Expert/topic/3823/3823946.xml?temp=.152096
http://community.csdn.net/Expert/topic/3448/3448128.xml?temp=.2261927
http://community.csdn.net/Expert/topic/3136/3136255.xml?temp=.5062525
public string EncodingSMS(string s)
{
string result = string.Empty;
for(int i = 0; i < s.Length; i++)
{
if(s[i] <= 255)
{
byte[] temp1 = System.Text.Encoding.ASCII.GetBytes(s[i].ToString());
result += temp1[0].ToString("X");
}
else //中文
{
byte[] temp2 = System.Text.Encoding.Default.GetBytes(s[i].ToString());
for(int j = 0; j < temp2.Length; j ++)
{
result += temp2[j].ToString("X");
}
}
}
return result;
}
浙公网安备 33010602011771号