freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于udp的即時(shí)通信工具的設(shè)計(jì)開(kāi)發(fā)-資料下載頁(yè)

2025-06-22 17:29本頁(yè)面
  

【正文】 urn false。 userlist[i].status = true。//更改為在線狀態(tài) nowUserPosition[++nowUserNumber] = i。//添加在線用戶位置 userlist[i].position = nowUserNumber。//保存用在線用戶的位置 (userlist[i].userRecIPEndPoint)。//建立連接發(fā)送允許登錄 byte[] sendBytes = (allow + userlist[i].userName)。//string allowData = allow + userlist[i].userName。 (sendBytes, )。//通知請(qǐng)求登錄用戶登錄成功 send(userlist[userNumber].userName + 登錄成功, 1)。//通知在線用戶有用戶上線 return true。 } = new IPEndPoint(dstIP, dstPort)。//密碼錯(cuò)誤 byte[] sendRefuseBytes = (refuse)。 (sendRefuseBytes, )。//通知請(qǐng)求登錄用戶登錄失敗 return false。 } } private bool clientleave(string userName)//用戶下線函數(shù) { int i = searchclient(userName)。//查找用戶在用戶列表位置 if(i==1)//用戶不存在返回失敗 return false。 if (userlist[i].position == nowUserNumber) { nowUserNumber。 userlist[i].status = false。//用戶存在更改為下線狀態(tài) send(userlist[userNumber].userName + 下線成功, 1)。 return true。 } userlist[nowUserPosition[nowUserNumber]].position = userlist[i].position。//更改最后一個(gè)在線用戶的position為要下線用戶的position nowUserPosition[userlist[i].position] = nowUserPosition[nowUserNumber]。//將最后一個(gè)的在線用戶的用戶列表位置給要替換的位置并把在線用戶1 userlist[i].status = false。//用戶存在更改為下線狀態(tài) send(userlist[i].userName + 下線成功, 1)。 return true。//返回成功 } private void show()//顯示當(dāng)前服務(wù)器信息和在線用戶并更新用戶列表 { ()。 string name = ()。//獲取主機(jī)名 (服務(wù)器主機(jī)名: + name)。 IPHostEntry me = (name)。 (監(jiān)聽(tīng)端口: + recPort)。 (服務(wù)器所有IP地址:)。 foreach (IPAddress ip in ) { (ip)。 } ()。 int now_UserNumber = nowUserNumber +1。//當(dāng)前用戶數(shù) string information = 當(dāng)前用戶數(shù):+()+ 用戶列表。 (information)。 string allclient = 用戶列表。//發(fā)送到客戶端的用戶列表數(shù)據(jù) for (int i = 0。 i =nowUserNumber。 i++) { string userName=userlist[nowUserPosition[i]].userName。//由用戶位置得到用戶名 allclient += userName + 。 (userName)。 } send(allclient, 1)。//刷新客戶端用戶列表 } private void send(string sendData,int noRec)//對(duì)除noRec在線用戶進(jìn)行群發(fā) { byte[]sendBytes=(sendData)。 for (int i = 0。 i = nowUserNumber。 i++)//發(fā)送給在線用戶 { if(i!=noRec)//不是noRec用戶 { (userlist[nowUserPosition[i]].userRecIPEndPoint)。//發(fā)送給第i個(gè)在線用戶 (sendBytes, )。 } } } private void listen()//監(jiān)聽(tīng)函數(shù) { IPEndPoint iep = null。 while (true) { byte[] receiveBytes = (ref iep)。 //ref表示引用類型的 IPPoint實(shí)例接收數(shù)據(jù) while (0)//接收到數(shù)據(jù) { string receiveData = (receiveBytes)。//一般數(shù)據(jù)組成:用戶名+消息 IPAddress dstIP = 。//獲取消息的源IP string []divideData=(39。39。)。//數(shù)據(jù)劃分 int clientNumber=searchclient(divideData[0])。//獲取用戶在用戶列表中的位置 if (clientNumber==1) { if ((login))//登錄數(shù)據(jù)組成:登錄指令+接收端口+用戶名+用戶密碼 { if (clientLogin(receiveData, dstIP) == true)//登錄成功 { show()。//刷新服務(wù)器和客戶端用戶列表 break。 } } break。 } if (divideData[1]==leave)//收到下線指令leave { if (clientleave(userlist[clientNumber].userName)==true)//下線成功 { show()。//刷新服務(wù)器和客戶端用戶列表 break。 } break。 } send(receiveData, 1)。 //userlist[clientNumber].position)。 //轉(zhuǎn)發(fā)消息給客戶端 string dataTime = ()。//獲取當(dāng)前系統(tǒng)時(shí)間 (dataTime)。//顯示發(fā)送時(shí)間 (receiveData)。//顯示發(fā)送用戶和發(fā)送內(nèi)容 break。 } } } private void Receive()//啟動(dòng)接收線程 { receiveThread = new Thread(new ThreadStart(listen))。 = true。 ()。 } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (receiveThread != null)//關(guān)閉接收線程 ()。 } private void Form1_Load(object sender, EventArgs e) { } private void serverInformation_SelectedIndexChanged(object sender, EventArgs e) { } private void message_SelectedIndexChanged(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void btnSaveMesssage_Click(object sender, EventArgs e)//保存消息日志 { string dataTime = ()。 //實(shí)例化一個(gè)保存文件對(duì)話框 SaveFileDialog sf = new SaveFileDialog()。 //設(shè)置文件保存類型 = txt文件|*.txt|所有文件|*.*。 //如果用戶沒(méi)有輸入擴(kuò)展名,自動(dòng)追加后綴 = true。 //設(shè)置標(biāo)題 = dataTim
點(diǎn)擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1