C# TCP ·þÎñ¶Ë(PC)Óë¿Í»§¶Ë(PPC) ¼òµ¥´úÂë
·þÎñÆ÷¶Ë´úÂë
¿Ø¼þ£ºbtnStart_Click£¬btnSend_Click£¬label4£¬textBox1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Threading;
using System.Net.Sockets;
using System.Net;
namespace MobileServer
{
public partial class FrmEasy : Form
{
//±äÁ¿
private ThreadStart start;
private Thread listenThread,client_th;
static private bool m_bListening = false;
//static private System.Net.IPAddress MyIP = System.Net.IPAddress.Parse("192.168.1.3");
//»ñµÃµ±Ç°·þÎñ¶ËµÄIP µØÖ·
static private System.Net.IPAddress MyIP = Dns.Resolve(Dns.GetHostName()).AddressList[0];
static private TcpListener listener = new TcpListener(MyIP, 5567);
private String msg;
ArrayList clientArray = new ArrayList();
public FrmEasy()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
start = new ThreadStart(startListen);
listenThread = new Thread(start);
}
private void btnStart_Click(objec
Ïà¹ØÎĵµ£º
Ê×ÏÈдһ¸öÒ³Ãæ£¬ÉÏÃæÒª·ÅÒ»¸öButton
<html>
<head>
<title></title>
</head>
<body>
<input id="Button1" type="button" value="button" />
</body>
</html>
½«Æä±£´ ......
1 using System;
2 using System.Collections;
3 using System.Configuration;
4 using System.Data;
5 using System.Linq;
6 using System.Web;
7 using System.Web.Security;
8 using&nbs ......
Ò»£®ÀàÓë½á¹¹µÄʾÀý±È½Ï£º
½á¹¹Ê¾Àý£º
public struct Person
{
string Name;
int height;
int weight
public bool overWeight()
{
//implement something
}
}
ÀàʾÀý£º
public class TestTime
{
int hours;
int minutes;
int seconds;
public void passtime()
{
//implementation ......
ÏÈÉùÃ÷£¬ÎÒ²»ÊÇÕâ·½ÃæµÄר¼Ò£¬Ö»ÊǸÉÈí¼þËĸöÔ²»ÖªÌìÓжà¸ßµØÓжàÓ²µÄСº¢×Ó
Ê×ÏÈ£¬ÀàÐÍת»»ÊÇÓÐÒ»¶¨¿ªÏúµÄ
ÎÒÊÔ¹ýÕâÑùµÄ´úÂ룺ÕâÊÇÒ»¸ö¿ØÖÆÌ¨Ó¦ÓóÌÐòµÄProgramÀàµÄ´úÂë
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ÀàÐÍת»»µÄ¿ªÏú
{
class Program
......