C#??????SOCKET????
???????????? ???????[ 2013/11/26 14:33:31 ] ????????
??????????
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace GameClient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender?? EventArgs e)
{
IPAddress serverIp = IPAddress.Parse("127.0.0.1");
string Port = "8001";
IPEndPoint serverhost = new IPEndPoint(serverIp?? Int32.Parse(Port));
Socket client = new Socket(AddressFamily.InterNetwork?? SocketType.Stream?? ProtocolType.Tcp);
try
{
client.Connect(serverhost);
}
catch
{
MessageBox.Show("???????");
return;
}
string id = textBox_id.Text;
//string pas = textBox_pas.Text;
// byte[] byteId = Encoding.ASCII.GetBytes(id.ToCharArray());
byte[] byteId = Encoding.GetEncoding("GB2312").GetBytes(id.ToCharArray());
//byte[] bytePas = Encoding.ASCII.GetBytes(pas.ToCharArray());
client.Send(byteId?? 0?? byteId.Length?? SocketFlags.None);
test.Text = Convert.ToString(byteId.Length);
//client.Send(bytePas?? 0?? bytePas.Length?? SocketFlags.None);
client.Close();
}
}
}
|
????Encoding.GetEncoding("GB2312").GetBytes(id.ToCharArray())??string id = Encoding.GetEncoding("GB2312").GetString(receive?? 0?? i)???????????????????????
???????Try??catch??????????顣????????????????????????????÷?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????

???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????