資源簡介
操作系統(tǒng)的課程設計包括文章,論文,程序,流程圖

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
#region
using?System.IO;
using?System.Net.Sockets;
using?System.Net;
using?System.Threading;
#endregion
namespace?P2PSample
{
????public?partial?class?frmP2P?:?Form
????{
????????//=======================================================
????????#region?Delegate
????????protected?delegate?void?ShowMessageDelegate(string?msg);//消息委托1
????????protected?delegate?void?ShowMessageDelegate2(string?ipStr?string?portStr?string?msgType?string?msg);//消息委托2
????????protected?delegate?void?ShowIpAndPortDelegate();//顯示IP與端口委托
????????protected?delegate?void?addMyfriendDelegate(string?IpStr?string?portStr);//添加好友
????????#endregion
????????//=======================================================
????????#region?Member
????????private?Thread?th;//啟動監(jiān)聽的線程
????????private?IPAddress?myIPAddress;//本機IP地址
????????private?Socket?socket?=?null;//客戶端
????????private?int?myPort;//本機端口
????????bool?OnlyOne?=?true;//連接只能是一次
????????#endregion
????????//=======================================================
????????#region?Construct
????????//構造函數(shù)
????????public?frmP2P()
????????{
????????????InitializeComponent();
????????????//設置窗體屬性
????????????this.MaximizeBox?=?false;
????????????this.FormBorderstyle?=?FormBorderstyle.FixedSingle;
????????????//設置列標頭
????????????ColumnHeader?ipColumn?=?new?ColumnHeader();
????????????ipColumn.Text?=?“IP“;
????????????ipColumn.Width?=?100;
????????????ColumnHeader?portColumn?=?new?ColumnHeader();
????????????portColumn.Text?=?“端口號“;
????????????//設置視圖顯示方式
????????????this.listViewMyFriend.View?=?View.Details;
????????????this.listViewMyFriend.Columns.AddRange(new?ColumnHeader[]?{?ipColumn?portColumn});//加載列標頭
????????????//默認的IP,PORT
????????????this.txtRomIP.Text?=?“10.106.2.50“;
????????????this.txtRomPort.Text?=?“1024“;
????????}
????????#endregion
????????//=======================================================
????????#region?Public?Function
????????#endregion
????????//=======================================================
????????#region?Private?Function
????????private?void?receiveMsg()
????????{
????????????bool?IsOK?=?true;
????????????while?(IsOK)
????????????{
????????????????try
????????????????{
????????????????????//執(zhí)行積壓在消息隊列中的信息防止循環(huán)出現(xiàn)界面凍結
????????????????????Application.DoEvents();
????????????????????NetworkStream?stream?=?new?NetworkStream(socket);//得到該連接流對象
????????????????????StreamReader?sr?=?new?StreamReader(stream);//創(chuàng)建只讀流對象
????????????????????string?receiveMsg?=?sr.ReadLine();
????????????????????//分割消息段
????????????????????int?i1?=?receiveMsg.IndexOf(““);
????????????????????int?i2?=?receiveMsg.IndexOf(““?i1?+?1);
????????????????????int?i3?=?receiveMsg.IndexOf(““?i2?+?1);
????????????????????string?ipString?=?receiveMsg.Substring(0?i1);//IP地址
??????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????30720??2008-12-03?16:45??操作系統(tǒng)課設\操作系統(tǒng).doc
?????文件????????916??2008-01-13?18:14??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\p2pClient.sln
????..A..H.?????20992??2009-01-02?21:16??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\p2pClient.suo
?????文件??????91648??2008-01-15?22:03??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\p2pClient.vsd
?????文件??????28672??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\bin\Debug\P2PSample.exe
?????文件??????32256??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\bin\Debug\P2PSample.pdb
?????文件???????5632??2005-11-11?22:25??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\bin\Debug\P2PSample.vshost.exe
?????文件???????1332??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\ClassDiagram1.cd
?????文件??????11359??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\frmP2P.cs
?????文件??????12047??2008-01-13?22:00??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\frmP2P.Designer.cs
?????文件???????6012??2008-01-13?22:00??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\frmP2P.resx
?????文件????????843??2008-06-07?16:08??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\Debug\p2pClient.csproj.GenerateResource.Cache
?????文件????????843??2008-01-12?23:12??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\Debug\P2PSample.csproj.GenerateResource.Cache
?????文件??????28672??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\Debug\P2PSample.exe
?????文件????????180??2008-01-14?11:53??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\Debug\P2PSample.frmP2P.resources
?????文件??????32256??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\Debug\P2PSample.pdb
?????文件????????180??2008-01-14?11:53??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\Debug\P2PSample.Properties.Resources.resources
?????文件????????283??2009-01-02?21:16??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\p2pClient.csproj.FileList.txt
?????文件???????1227??2008-06-07?16:09??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\p2pClient.csproj.FileListAbsolute.txt
?????文件????????283??2008-01-13?18:08??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\obj\P2PSample.csproj.FileList.txt
?????文件???????3271??2008-01-15?10:31??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\p2pClient.csproj
?????文件????????469??2007-05-11?09:51??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\Program.cs
?????文件???????1208??2007-05-11?09:49??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\Properties\AssemblyInfo.cs
?????文件???????2872??2007-05-11?09:49??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\Properties\Resources.Designer.cs
?????文件???????5612??2007-05-11?09:49??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\Properties\Resources.resx
?????文件???????1092??2007-05-11?09:49??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\Properties\Settings.Designer.cs
?????文件????????249??2007-05-11?09:49??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\P2PClient\P2PSample\Properties\Settings.settings
?????文件??????28672??2008-01-15?10:32??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\p2pserver\P2PSample\bin\Debug\P2PSample.exe
?????文件??????34304??2008-01-15?10:32??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\p2pserver\P2PSample\bin\Debug\P2PSample.pdb
?????文件???????5632??2005-11-11?22:25??操作系統(tǒng)課設\操作系統(tǒng)課程設計報告\p2pserver\P2PSample\bin\Debug\P2PSample.vshost.exe
............此處省略47個文件信息
評論
共有 條評論