public TalkWindow(User user,Font myfont,MainWindow parent) { InitializeComponent(); //获得对方的信息 TalkUser = user; //获得父窗口 Parent = parent; //获得我的名字 myname = parent.Hoster.name; //获得字体 MyFont = myfont; //未发送文件中 Is_Sending = false; Is_Send = false; //初始化窗体信息 InitialWindow(); //初始化字体信息 SetFontStyle(); //初始化表情信息 InitialExpression(); }
private void InitialHoster() { Hoster = new User(); Hoster.image = "Images/portrait/12.jpg"; Hoster.name = Dns.GetHostName(); Hoster.HostName = Dns.GetHostName(); IPHostEntry ipEntry = Dns.GetHostByName(Hoster.HostName); //取得本机IP Hoster.ip = ipEntry.AddressList[0].ToString(); //假设本地主机为单网卡 Hoster.talk = "要努力奋斗,养活一家老小"; }