我正在写 ac# 更改密码页面。我没有做过太多的 Socket 编程,我不确定最好的方法。
必须有控制台应用程序(服务器)和带有以下文本框的 html 页面(客户端):
Username [_______]
Old password [______]
New password [______]
       [Submit]
然后当用户单击提交时,将创建一个新线程,我正在检查信息是否良好并且将执行一些功能。
这应该在定义的端口上接受来自多个客户端的连接。
我怎样才能做到这一点?
到目前为止我所做的是:
    public static TcpListener Listener;
    public static int Port = 8080;
static void Main(string[] args)  
   {
        IniFile FPth = new IniFile(@"D:\ServerInfo.ini");
        ServerPort = int.Parse(FPth.IniReadValue("ConnectionINFO", "ServerPort"));
        Listener = new TcpListener(IPAddress.Any, Port);
        Listener.Start();
        Thread NewThread = new Thread(new ThreadStart(ChangingINFO));
        ChangingINFO();
        Console.WriteLine("Server is ONLINE.");
   }
static ChangingINFO()
{
         while (true)
            {
                Socket Sockt = Listener.AcceptSocket();
                try
                {
                    if (Sockt.Connected)
                    {
                     //Here I should get the information from the client on submit.
                     //But I don't know how
                    }
}
但我不知道如何制作将信息发送到服务器并与它们一起工作的 html 页面。