使用c#实现简易的http传输
2021-02-17 14:19
标签:buffer completed 服务 ini orm private net 发送 his 使用最简易的方法实现http传输 返回固定数值 使用c#实现简易的http传输 标签:buffer completed 服务 ini orm private net 发送 his 原文地址:https://www.cnblogs.com/cxlater/p/8371590.htmlpublic partial class Form1 : Form
{
static Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); //侦听socket
public Form1()
{
InitializeComponent();
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string c = CookieReader.GetCookie("http://10.33.208.230/uac/");
this.textBox1.Text = c;
Program.cookie = c;
this.Text = "服务端:" + webBrowser1.Document.Title;
}
private void Form1_Shown(object sender, EventArgs e)
{
_socket.Bind(new IPEndPoint(IPAddress.Any, 8123));
_socket.Listen(100);
_socket.BeginAccept(new AsyncCallback(OnAccept), _socket);
}
///