usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceQuickSort{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}
1
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespace图书管理系统{publicpartialclass登录窗口:Form{//publicstaticstringConnectionString="Server=(local);database=图书管理库;uid=sa;pwd=1234";//sqlserver混合模式//publicstaticstringConnectionString="Server=(local);IntegratedSecurity=SSPI;database=图书管理库";//windows模式publicstringstrSQL;publicSqlConnectionmyConnection;publicSqlCommandBuildersqlCmdBld;publicDataSetds=newDataSet();publicSqlDataAdapterda;publicintnum=0;privateDataTablemyTable;privateDataRowmyRow;publicstaticstringstrUser;publicstaticstringstrPassword;//publicstaticstringstrDepartment;publicstaticboollogin_flag=false;public登录窗口(){InitializeComponent();}privatevoidbutton2_Click(objectsender,EventArgse){Close();}privatevoid登录窗口_Load(objectsender,EventArgse){linkdatabaselink=newlinkdatabase();//实例化myConnection=newSqlConnection(link.connectionstring());//实例化连接strSQL="select*from用户表";da=newSqlDataAdapter(strSQL,myConnection);ds.Clear();da.Fill(ds,"用户表");//////动作myTable=ds.Tables["用户表"];for(inti=0;i<myTable.Rows.Count;i++){comboBox1.Items.Add(myTable.Rows[i]["用户名"].ToString().Trim());}}privatevoidbutton1_Click(objectsender,EventArgse){linkdatabaselink=newlinkdatabase();//实例化myConnection=newSqlConnection(link.connectionstring());//实例化连接strSQL="sele
2024/8/20 10:41:13 7.26MB 管理
1
c#对并口的读写操作!INPOUT32.DLLusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Runtime.InteropServices;namespaceIED_Application{publicpartialclassIED:Form{//intled=0x278;[DllImport("inpout32.dll",EntryPoint="Out32")]publicstaticexternvoidOutput(intadress,intvalue);[DllImport("user32.dll",EntryPoint="MessageBoxA")]publicstaticexternvoidMsgBox(inthWnd,stringmsg,stringcaption,inttype);publicIED(){InitializeComponent();}privatevoidIED_Load(objectsender,EventArgse){}privatevoidoutput_Click(objectsender,EventArgse){MsgBox(0,"这里是用DllImport","tiaozhanbei",0x30);IED.Output(888,253);}}}
2024/7/19 7:04:44 499KB c# 并口
1
C#.net实现学生成绩管理系统namespace学生成绩管理系统{partialclassFormlogin{//////必需的设计器变量。
///privateSystem.ComponentModel.IContainercomponents=null;//////清理所有正在使用的资源。
//////如果应释放托管资源,为true;
否则为false。
protectedoverridevoidDispose(booldisposing){if(disposing&&(components!=null)){components.Dispose();}base.Dispose(disposing);}#regionWindows窗体设计器生成的代码//////设计器支持所需的方法-不要///使用代码编辑器修改此方法的内容。
///privatevoidInitializeComponent(){this.labeluser=newSystem.Windows.Forms.Label();this.textBoxuser=newSystem.Windows.Forms.TextBox();this.labelcode=newSystem.Windows.Forms.Label();this.textBoxcode=newSystem.Windows.Forms.TextBox();this.buttonin=newSystem.Windows.Forms.Button();this.buttonout=newSystem.Windows.Forms.Button();this.SuspendLayout();////labeluser//this.labeluser.Font=newSystem.Drawing.Font("宋体",10.5F,System.Drawing.FontStyle.Regular,System.Drawing.GraphicsUnit.Point,((byte)(134)));this.labeluser.Location=newSystem.Drawing.Point(31,50);this.labeluser.Name="labeluser";this.labeluser.Size=newSystem.Drawing.Size(55,26);this.labeluser.TabIndex=0;this.labeluser.Text="用户名";this.labeluser.TextAlign=System.Drawing.ContentAlignment.MiddleCenter;////textBoxuser//this.textBoxuser.Location=newSystem.Drawing.Point(126,55);this.textBoxuser.Name="textBoxuser";this.textBoxuser.Size=newSystem.Drawing.S
2024/3/13 12:24:54 257KB 学生成绩管理系统(C#)
1
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;usingSystem.Configuration;namespacePhoneBook{publicpartialclassfrmMain:Form{publicfrmMain(){InitializeComponent();}privatestringstrConn=System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];privatevoidfrmMain_Load(objectsender,EventArgse){LoadGroup();if(trvGroup.Nodes.Count>0){trvGroup.SelectedNode=trvGroup.Nodes[0];LoadList();}else{lvContact.Clear();}}privatevoidLoadGroup(){try{trvGroup.Nodes.Clear();SqlConnectionconn=newSqlConnection(strConn);SqlCommandcmd=newSqlCommand();cmd.Connection=conn;cmd.CommandText="selectdistinct组别from联系人where用户名='"+tsslUserName.Text+"'";conn.Open();SqlDataReadersdr=cmd.ExecuteReader();while(sdr.Read()){trvGroup.Nodes.Add(sdr[0].ToString());}sdr.Close();conn.Close();}catch{}}privatevoidLoadList(){if(trvGroup.Nodes.Count==0){lvContact.Clear();return;}if(trvGroup.SelectedNode.Index>=0){stringstrGroup=trvGroup.SelectedNode.Text;try{lvContact.Clear();lvContact.Columns.Add("姓名",100);lvContact.Columns.Add("工作
2023/12/9 9:50:34 1.54MB C# 管理系统
1
一.系统设计1.1系统功能分析随着经济的飞速发展人们的收入越来越高,相应的娱乐设施也越来越多,电影是人们的最佳选择,那么影院的售票及管理系统是一个供观众直观查看影片信息的系统,可以为观众提供影片的播放时间、播放的地点、影片的风格以及影片的票价(会员折扣)的信息,其中还需要提供给观众一个近期影片最佳排行,可通过此排行榜直观选择所喜欢的电影。
1.2系统功能模块设计1.2.1设计界面 本系统的主界面是一个多文档窗体,使用MDI窗体可以使程序条理清晰,井然有序,因为MDI窗体是父窗体,它负责整个程序的启动和关闭,其他的窗体都是它的子窗体。
一个应用程序只能有一个MDI窗体,但可以拥有多个子窗体。
单击“工具栏”→“添加控件”菜单添加菜单 使用菜单编辑器为本主窗体添加多级菜单。
登录系统菜单 用户登录、密码、类型、退出 影片管理菜单 增加影片、修改影片、影片信息 售票管理菜单 查询订票、钱箱查询、订购电影票 会员管理菜单 会员信息、会员注册usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;usingSystem.Diagnostics;namespaceFilmsSelect{publicpartialclassMainForm:Form{publicMainForm(){InitializeComponent();}
1
在.NETMVC中,当页面提交model到Action的时候,自动填充ModelState。
使用ModelState.IsValid进行方便快捷的数据验证,其验证也是调用命名空间System.ComponentModel.DataAnnotations和System.ComponentModel中的各种方法进行验证。
但是,使用非MVC架构时,就需要写很多if判断或者正则表达式,当有多个字段需要验证的时候就需要写很多if判断,即繁琐,又不美观。
这里记录一个方法,使用System.ComponentModel.DataAnnotations和System.ComponentModel来实现本人
2017/3/19 23:50:32 192KB c# DataAnnotations Model验证 ComponentModel
1
usingStu_System.DataSetTableAdapters;[System.ComponentModel.DataObject][System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select,true)]用强类型定义和数据集将逻辑层和表现层分开,做的一个恨简单的系统,可以学习参考
2015/11/17 21:22:22 736KB 学生 查询 成绩 系统
1
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Net;usingSystem.Net.Sockets;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespaceSocketClient{publicpartialclassSocketClient:Form{publicdelegatevoidUpdateReceiveMsgCallback(stringmsg);//定义委托变量byte[]dataBuffer=newbyte[10];//定义一个byte类型数组IAsyncResultresult;publicAsyncCallbackpfnCallBack;publicSocketclientSocket;//机关函数publicSocketClient(){InitializeComponent();//初始化tb_ServerIP.Text=InitializeInfo();tb_ServerPort.Text="8000";}
2020/2/15 22:47:36 101KB C# TCP客户端
1
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡