解决方案 »

  1.   

    在write后面添加如下代码  context.Response.Write("");
     context.Response.End();//关闭输出流,不然会将页面结构返回
      

  2.   

    大致是:
                if (table.Rows.Count > 0)  //大于说明有这个会员
                {
                                if (table.Rows[0]["Password"].ToString() == Encrypt.EncryptPwd(pwd.Trim(), "MD5"))  //判断密码是否正确
                    {
                                        report= DataToXml.CDataToXml(table));   这里返回他的xml信息
                    }
                    else
                    {
                         report = Encoding. "0";  //0就是帐号或者密码错误
             }
                }
                else
                {
                    report = "0";
                }
               byte[] rep = Encoding.Utf8.GetBytes(report);
                context.Response.OutputStream.Write(rep, 0,  rep.Length);
      

  3.   

    大致是
                        if (table.Rows.Count > 0)  //大于说明有这个会员
                {
                                 if (table.Rows[0]["Password"].ToString() == Encrypt.EncryptPwd(pwd.Trim(), "MD5"))  //判断密码是否正确
                    {
                                         report= DataToXml.CDataToXml(table));   这里返回他的xml信息
                    }
                     else
                     {
                          report = "0";  //0就是帐号或者密码错误
             }
                 }
                 else
                 {
                     report = "0";
                 }
                byte[] rep = Encoding.Utf8.GetBytes(report);
                context.Response.OutputStream.Write(rep, 0,  rep.Length);
      

  4.   

    返回json数据比较好些,处理也方便。
    大家基本都是这样做的。
      

  5.   


    想请问
    byte[] rep = Encoding.Utf8.GetBytes(report);
                context.Response.OutputStream.Write(rep, 0,  rep.Length);
    这样的写法和我的写法有什么区别呀?
    还有,我想在xml里面加入table另外的数据,比如说当前服务器时间。应该怎么加进去?