Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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:
"
&


Ïà¹ØÎĵµ£º

C# Active¿Ø¼þ£¬²¢´¥·¢javascriptʼþ

´´½¨Ò»¸öWinformÓû§¿Ø¼þ UserControl1
 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
namespace MyActiveT ......

ÓÃC#´´½¨XML[¼òµ¥´úÂë]

XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......

C# ¸ñʽ»¯Êä³öXML

ºÜ¶àʱºòÓÐÒ»¸öxml×Ö·û´®£¬Ã»Óл»ÐУ¬Ã»ÓÐËõ½ø£¬ÒªÉú³ÉxmlÎļþ²»Ò×ÔĶÁ¡£ÏÂÃæµÄ´úÂë¾ÍÊÇÔõô½«Ò»¸öÁ¬ÐøµÄxml×Ö·û´®¸ñʽ»¯Êä³ö
// a demo string
string xml = "<Root><Eles><Ele>abc</Ele><Ele>123</Ele></Eles></Root>";
System.Xml.XmlDocument doc = new System.Xml ......

C# ¿ìËٹػú´úÂë

½ñÌìÓõ½Õâ¸ö£¬ÍøÉÏÕÒ¸ö²»´íµÄ£¬±£´æÏÂÀ´¡£
×¢Ò⣺Õâ¸ö·½·¨ÊÇ¿ìËٹػú£¬²»»á±£´æÄãµÄÈκÎδ±£´æÐÅÏ¢¡£
// Õâ¸ö½á¹¹Ì彫»á´«µÝ¸øAPI¡£Ê¹ÓÃStructLayout
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TokPriv1Luid
{
public int Count;
public ......

C# CHM°ïÖúÎĵµÉú³É¹¤¾ß

C# CHM°ïÖúÎĵµÉú³É¹¤¾ß-Sandcastle
ΪÁËÈÃÎÒÃǵĿª·¢ÍŶӹ淶Îĵµ£¬²¢Ò×ÓÚ½»Á÷£¬×îÖÕʹÓÃÁËSandcastleÉú³Échm¸ñʽÎĵµ¡£
Ò»¡¢ÏÂÔØ¡£
ÎÒ·¢ÏÖÓÐÁ½ÖÖSandcastle¿É¹©ÏÂÔØ£¬Ò»¸öÊǹٷ½µÄSandcastle£¬ÁíÒ»¸öÊÇSandcastleGUI£¨Í¼ÐνçÃæµÄ£©¡£
ǰһ¸öÊDZØÐë°²×°µÄ£¬È»ºóÔÙÏÂÔØ¸öSandcastleGUI£¬Ö±½ÓʹÓü´¿É£¬ÏÂÔØµØÖ·Îª£º
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ