异常详细信息: System.Net.Sockets.SocketException: 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。初步估计是这个方法出了问题。(本机没问题,放到服务器就出现这个问题了)
/// <summary>
        /// 邮箱验证
        /// </summary>
        private void CheckUser()
        {
            string code = Request.QueryString["key"].Trim();
            string uid = Lang.Decrypt(code);            sql = "select * from Sy_Authcode where UserID='" + uid + "' and Code ='" + Request.QueryString["key"].Trim() + "'";
            DataTable dt = SelectEntity.BaseAccess.GetDataTable(sql);
            if (dt.Rows.Count < 1)
            {
                Lang.ShowMessage("验证失败!");
            }
            else
            {                if (SelectEntity.BaseAccess.GetDataTable("select * from HY_PageSet where userid='" + uid + "'").Rows.Count < 1)
                {
                    MemberCompetence.SetDefaultPageSet(uid);
                    CreatHTML.CreatePage(uid, MemberCompetence.IsJianCaiUser(uid).Trim() != "jc" ? true : false);
                }
                sql = "update Sy_Authcode set IsChecked = 1 where UserID='" + uid + "' and Code ='" + code + "'";
                SelectEntity.BaseAccess.Update(sql);
                Lang.ShowMessage("验证成功,您现在可以登陆后台进行操作了!");
            }
        }这个方法要改?
还是做什么措施?
看了网上的一些回答好像不怎么适合我这个 。分不够可以+

解决方案 »

  1.   

    完整信息:
    由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。 202.165.103.162:25 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Net.Sockets.SocketException: 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。 202.165.103.162:25源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
    [SocketException (0x2747): 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作。 202.165.103.162:25]
       System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
       System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
       System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224[WebException: 无法连接到远程服务器]
       System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5483819
       System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
       System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
       System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
       System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
       System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
       System.Net.Mail.SmtpClient.GetConnection() +35
       System.Net.Mail.SmtpClient.Send(MailMessage message) +1213[SmtpException: 发送邮件失败。]
       Siiit.Sun.Web.RegZhuangShi.SendMail(String to, String name) in E:\DotNet\Sun\SunDecorativeSystem\RegZhuangShi.aspx.cs:228
       Siiit.Sun.Web.RegZhuangShi.btnSave_Click(Object sender, EventArgs e) in E:\DotNet\Sun\SunDecorativeSystem\RegZhuangShi.aspx.cs:171
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 
    --------------------------------------------------------------------------------
    版本信息: Microsoft .NET Framework 版本:2.0.50727.3615; ASP.NET 版本:2.0.50727.3614 
      

  2.   

    补充:
    上面说的方法拷错了:        /// <summary>
            /// 发送信息
            /// </summary>
            /// <param name="mobilePhone">手机号,多个用","号隔开</param>
            /// <param name="type">通道类型选择,0 是默认,2 通道2, 3 即时通道</param>
            /// <param name="msg">内容</param>
            private void SendMessage(string mobilePhone, string name, string password)
            {
                //string smsAbout = Request.Form["smsAbout"];
                //string txtdtTime = Request.Form["txtdtTime"];
                string type="0";
                string msg = "亲爱的 " + name + " 欢迎加入阳光装饰平台,您的密码为:" + password + ",系统已经发送邮件到您的邮箱,请您及时查收验证!";
                string ress = "";
                SMSClient smsClient = null;
                try
                {
                    string server = WebConfigurationManager.AppSettings["HostName"];
                    string port = WebConfigurationManager.AppSettings["HostPort"];
                    string SMSUser = WebConfigurationManager.AppSettings["SMSUser"];
                    string SMSPassword = WebConfigurationManager.AppSettings["SMSPassword"];                smsClient = new SMSClient(server, Convert.ToInt32(port), SMSUser, SMSPassword);                bool flag = smsClient.sendSMS(mobilePhone, msg, type);
                    if (flag)
                    {
                        ress = "成功";
                    }
                    else
                    {
                        ress = "失败";
                    }
                }
                catch (Exception ex)
                {
                    //wrongMsg = ex.Message;
                }
                Session["xml"] = smsClient.SendXML;
                Session["resxml"] = smsClient.ReceiveXML;
                //Lang.ShowMessage(ress);
            }
      

  3.   

    又拷错了(急的脑子都晕了。。):/// <summary>
            /// 发送信息
            /// </summary>
            /// <param name="mobilePhone">手机号,多个用","号隔开</param>
            /// <param name="type">通道类型选择,0 是默认,2 通道2, 3 即时通道</param>
            /// <param name="msg">内容</param>
            private void SendMessage(string mobilePhone, string name, string password)
            {
                //string smsAbout = Request.Form["smsAbout"];
                //string txtdtTime = Request.Form["txtdtTime"];
                string type="0";
                string msg = "亲爱的 " + name + " 欢迎加入阳光装饰平台,您的密码为:" + password + ",系统已经发送邮件到您的邮箱,请您及时查收验证!";
                string ress = "";
                SMSClient smsClient = null;
                try
                {
                    string server = WebConfigurationManager.AppSettings["HostName"];
                    string port = WebConfigurationManager.AppSettings["HostPort"];
                    string SMSUser = WebConfigurationManager.AppSettings["SMSUser"];
                    string SMSPassword = WebConfigurationManager.AppSettings["SMSPassword"];                smsClient = new SMSClient(server, Convert.ToInt32(port), SMSUser, SMSPassword);                bool flag = smsClient.sendSMS(mobilePhone, msg, type);
                    if (flag)
                    {
                        ress = "成功";
                    }
                    else
                    {
                        ress = "失败";
                    }
                }
                catch (Exception ex)
                {
                    //wrongMsg = ex.Message;
                }
                Session["xml"] = smsClient.SendXML;
                Session["resxml"] = smsClient.ReceiveXML;
                //Lang.ShowMessage(ress);
            }