server/FormServer.cs

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//引用
using System.Net;
using System.IO;
using System.Threading;
//using ExamData;
using dataModel;
//using Serialization1;
using serializedData;
using System.Net.Sockets;
using System.Data.SqlClient;

namespace server
{
    public partial class FormServer : Form
    {
        IPAddress Serverip;
        Thread Login = null;
        Thread Send = null;
        UdpClient udpsend = null;
        UdpClient udpClient = null;
        SqlConnection conn = null;
        string sqlStudenCode = "server = localhost; User Id = sa; Pwd = 51Aspx; Database = StudentDB";
        public static string getString(int len)
        {
            char[] CharArray = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
            int clens = CharArray.Length;
            string sCode = "";
            Random random = new Random();
            for (int i = 0; i < len; i++)
            {
                sCode += CharArray[random.Next(clens)];
            }
            return sCode;
        } //获取随机字符
        public FormServer()
        {
            CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            udpClient = new UdpClient(8000);//考试端口
        }
        private void FormServer_Load(object sender, EventArgs e)
        {
            button2.Enabled = false;
            button3.Enabled = false;              //ip地址解析       获取主机名
            foreach (IPAddress _IPAddress in Dns.GetHostEntry(Dns.GetHostName()).AddressList)//获取考试服务器ip
            {
                if (_IPAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                {
                    Serverip = _IPAddress;
                }

后面还有 230 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。