C#的TCP通信
TCP是连接模型,如下:
服务器连接 服务器断开
↓ ↑
服务器接收→服务器处理→服务器发送
↑ ↓
客户端发送←客户端处理←客户端接收
↑ ↓
客户端连接 客户端断开
服务器代码如下:
//
ServerListen
TcpListener tcplistener
=
new
TcpListener(
int
.Parse(txtPort.Text));
tcplistener.Start();
byte
[] btServerReceive
=
new
byte
[
256
];
string
strServerReceive
=
string
.Empty;
//
Loop for Listen
while
(
true
)
{
TcpClient tcp
=
tcplistener.AcceptTcpClient();
NetworkStream ns
=
tcp.GetStream();
int
intReceiveLength
=
ns.Read(btServerReceive,
0
,btServerReceive.Length);
strServerReceive
=
UnicodeEncoding.Unicode.GetString(btServerReceive,
0
,intReceiveLength);
txtServerResult.AppendText(
"
ServerReceive:
"
+
strServerReceive
+
"
"
);
ns.Write(btServerReceive,
0
,btServerReceive.Length);
txtServerResult.AppendText(
"
ServerSend:
"
&
相关文档:
//命名空间 using Microsoft.Win32;
private void checkBox2_CheckedChanged(object sender, System.EventArgs e)
{
if (checkBox2.Checked) //设置开机自启动
{
//MessageBox.Show ("设置开机自启动需要修改注册表","提示");
string path = Application.ExecutablePath;
RegistryKey rk = Registry.LocalMac ......
private void MakeLegend(IActiveView activeView,IPageLayout pageLayout)
{
//定义图例UID对象
UID uid = new UIDClass();
&n ......
http://www.tangiblesoftwaresolutions.com/Product_Details/Instant_CSharp.html
http://www.tangiblesoftwaresolutions.com/?gclid=COeGzKKxo58CFQIupAodu2jvJQ
在线
VB.net和C#在线互转工具
http://bbs.51aspx.com/showtopic-2059.html
Convert VB.NET to C#
http://www.developerfusion.com/tools/convert/vb-to- ......
C# CHM帮助文档生成工具-Sandcastle
为了让我们的开发团队规范文档,并易于交流,最终使用了Sandcastle生成chm格式文档。
一、下载。
我发现有两种Sandcastle可供下载,一个是官方的Sandcastle,另一个是SandcastleGUI(图形界面的)。
前一个是必须安装的,然后再下载个SandcastleGUI,直接使用即可,下载地址为:
......