标题:在PPC上测试发不出去,这是怎么回事?
只看楼主
gundumw100
Rank: 1
等 级:新手上路
帖 子:70
专家分:0
注 册:2008-1-22
 问题点数:0 回复次数:0 
在PPC上测试发不出去,这是怎么回事?
//代码片段,
//以下语句实现按确定键后发送消息,帮忙看看有什么错!
case ST_INFO_VALIDATE://还款信息确认
               NetProcess net = new NetProcess();//NetProcess见下面
               net.setMessageText("要发送的消息");//设置要发送的消息
               Thread t = new Thread(new ThreadStart(net.Run));//起线程发送
               t.Start();

//NetProcess类:
 class NetProcess
    {
        TcpClient client;
        NetworkStream stream;
        string IP = "220.248.36.5";        //socket://220.248.36.5
        int port = 6000;
        string s;
        public NetProcess()
        {
         }
        public void Connect()
        {
            client = new TcpClient();           
            try
            {
                client.Connect(IP, port);                                                               
                text = "连接服务器成功!";
            }
            catch (Exception e)
            {
                isFail = true;
                text = "连接失败!" + e.ToString();
            }
        }
        public void WriteData(string data)
        {
            Byte[] mybytes = Encoding.ASCII.GetBytes(data);
            stream = client.GetStream();
            stream.Write(mybytes, 0, mybytes.Length);

        }
        public void setMessageText(string s)
        {
            this.s = s;
        }
        public void Run()
        {
            Connect();
            WriteData(s);
        }
    }
在PPC上测试发不出去,说:

连接服务器失败!

无法显示错误消息,原因是无法找到包含此错误消息的可选资源程序集

检测socket.Connected一直是false
这是怎么回事?

[[it] 本帖最后由 gundumw100 于 2008-2-3 16:07 编辑 [/it]]
搜索更多相关主题的帖子: PPC 
2008-02-03 11:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-199413-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.477885 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved