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 System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
&nb ......
XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......
½ñÌìÓõ½Õâ¸ö£¬ÍøÉÏÕÒ¸ö²»´íµÄ£¬±£´æÏÂÀ´¡£
×¢Ò⣺Õâ¸ö·½·¨ÊÇ¿ìËٹػú£¬²»»á±£´æÄãµÄÈκÎδ±£´æÐÅÏ¢¡£
// Õâ¸ö½á¹¹Ì彫»á´«µÝ¸øAPI¡£Ê¹ÓÃStructLayout
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TokPriv1Luid
{
public int Count;
public ......
C# CHM°ïÖúÎĵµÉú³É¹¤¾ß-Sandcastle
ΪÁËÈÃÎÒÃǵĿª·¢ÍŶӹ淶Îĵµ£¬²¢Ò×ÓÚ½»Á÷£¬×îÖÕʹÓÃÁËSandcastleÉú³Échm¸ñʽÎĵµ¡£
Ò»¡¢ÏÂÔØ¡£
ÎÒ·¢ÏÖÓÐÁ½ÖÖSandcastle¿É¹©ÏÂÔØ£¬Ò»¸öÊǹٷ½µÄSandcastle£¬ÁíÒ»¸öÊÇSandcastleGUI£¨Í¼ÐνçÃæµÄ£©¡£
Ç°Ò»¸öÊDZØÐë°²×°µÄ£¬È»ºóÔÙÏÂÔظöSandcastleGUI£¬Ö±½ÓʹÓü´¿É£¬ÏÂÔصØַΪ£º
......