示例#1
0
文件: FormChat.cs 项目: JyBP/SupChat
        IPEndPoint targetIPEP; //server ipep

        #endregion Fields

        #region Constructors

        public FormChat(User _Me, User _myFriend, bool _modeIsClient, RSAengine _myRSAengine)
        {
            InitializeComponent();
            richTextBoxConversation.BackColor = Color.White;
            richTextBoxMessage.Select();

            myRSAengine = _myRSAengine;

            modeIsClient = _modeIsClient;
            myFriend = _myFriend;

            myFriend = new User(myFriend.getId());

            Me = _Me;
            if (myFriend == null || Me == null)
            {
                this.Dispose();
            }

            //get ip friend ici!!!!!!!!!!!
            /*
            myFriend.setInfos();
            Me.setInfos();
            */
            if(Me.getIPPublic()==myFriend.getIPPublic())
            {
                targetIP = myFriend.getIPLocal();
            }
            else
            {
                targetIP = myFriend.getIPPublic();
            }
            if (Program.debug)
            {
                FormDebugAccess.get().addLine("new form:" + targetIP);
            }
            string title = myFriend.getNom() + " (" + targetIP + ")";
            if (modeIsClient)
            {
                //title += " client";
            }
            else
            {
                //title += " server";
            }

            this.Text = title;
        }
示例#2
0
文件: FormHome.cs 项目: JyBP/SupChat
        private void Form1_Load(object sender, EventArgs e)
        {
            File.Delete("debug.txt");
            UPnP.NAT.WriteLineInFile("debug.txt","formload");

            myRSAengine = new RSAengine();

            listFriends = new List<User>();
            setHomeLogin();
            labelMessage.Text = "";

            textBoxPassword.PasswordChar = '*';
            textBoxLogin.Text = "jb";
            textBoxPassword.Text = "azerty";

            useUPnP = false;

            modeIsClient = true;
            this.Text = "SupChat";
            this.Refresh();

            /*
            WebServer.setFormHome(this);
            myFormDebug = new FormDebug();
            myFormDebug.Show();*/
        }