日期:2014-05-17  浏览次数:20939 次

HttpListner通过url传入中文参数就是乱码 在线等
1.winform程序通过输入网址http://localhost:8080/web/?USERID=221122&MOBILE_NO=1500166624,1342655556&SMS_CONTENT=2322中文
在程序里 string SMS_CONTENT = hlc.Request.QueryString[canshu4];拿到这个值的话 是2322乱码
我如何才能正确的拿到2322中文这个值 请大神们帮忙解决下
try
            {
                //创建HttpListener对象
                using (HttpListener hlistener = new HttpListener())
                {
                    //获取设置用户端身份验证
                    hlistener.AuthenticationSchemes = AuthenticationSchemes.Anonymous;
                    //设置url前缀$
                    //hlistener.Prefixes.Add("http://localhost:8080/web/");
                    //通过IP来访问
                    //获取app.config文件的url地址
                    string HttpUrl = System.Configuration.ConfigurationManager.AppSettings["HttpURL"].ToString();
                  
                    hlistener.Prefixes.Add(HttpUrl);
                    //接收传入请求
                    hlistener.Start();
                    //创建connection对象
                    SqlConnection conn = new SqlConnection("server=.;database=StuTest;uid=sa;pwd=xdxadmin");
                    while (true)