C#label的值怎么与textbox的值进行比较?

C# 一个label的值怎么和textbox的值进行比较?label的值不能引用label.text这要如何进行比较?

2个回答

    // 放1个Label、1个TextBox、1个Button
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.label1.Text == this.textBox1.Text) {
                MessageBox.Show("相等");
            }else{
                MessageBox.Show("不等");
            }
        }
    }
liaocc114
liaocc114 你看下楼的发的图片没有text的选项
接近 3 年之前 回复

图片说明

u013154152
Rains_ 你这个是asp.net还是wpf,wpf没有text属性,要用Content
接近 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
c#如何hook拦截并屏蔽textbox里接收的消息,替换成自己指定的字符串?
1.一个程序里的窗口会接收com口或随机的字符串,想学习一下如何劫持这个窗口让它在接收前,先审核一下条件,后台运算后(比如+100)在到文本框。 2.小程序代码如下: ``` 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.Threading.Tasks; using System.IO.Ports; namespace text { public partial class Form1 : Form { public string receiveing = string.Empty; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { timer1.Enabled = true; } private void timer1_Tick(object sender, EventArgs e) { Random r = new Random(); textBox1.Text = r.Next(1000, 10000).ToString(); } private void button3_Click(object sender, EventArgs e) { timer1.Enabled = false; label1.Text = textBox1.Text+"保存成功!"; } private void serialPort2_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { receiveing = serialPort2.ReadLine(); } private void Form1_Load(object sender, EventArgs e) { serialPort2.Open(); } private void button2_Click(object sender, EventArgs e) { textBox1.Text = receiveing; } } } ``` 3.要求大神提供c#hook程序的源代码,小白再次万分感谢 4.补充一下是通过您自己的程序代码起到作用,而不是修改我上面的代码,我的代码就是个测试的小程序
C#委託事件如何更新UI的值
我想在一個委託事件中更新ui值,但是總是報錯,請幫我看看: ``` System.InvalidOperationException: '跨執行緒作業無效: 存取控制項 'tb_log' 時所使用的執行緒與建立控制項的執行緒不同。' ``` 我的代碼如下: ``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace MavenInstall { public partial class MavenInstall : Form { public delegate void OutDelegate(string txt); public OutDelegate outDelegate; public MavenInstall() { InitializeComponent(); tb_packaging.Text = "jar"; outDelegate = UpdateLog; //tb_command.Text = "mvn install:install-file -DgroupId={0} -DartifactId={1} -Dversion={2} -Dpackaging={3} -Dfile={4}"; } private void btn_select_Click(object sender, EventArgs e) { if (SelectJarFile.ShowDialog() == DialogResult.OK) { tb_file.Text = SelectJarFile.FileName; } } private void btn_execute_Click(object sender, EventArgs e) { tb_log.Text = null; foreach (Control control in gb_condition.Controls) { control.Enabled = false; } String cmd = String.Format(@"mvn install:install-file -DgroupId={0} -DartifactId={1} -Dversion={2} -Dpackaging={3} -Dfile={4}" , tb_groupid.Text,tb_artifactid.Text ,tb_version.Text,tb_packaging.Text,tb_file.Text); tb_command.Text = cmd; Process process = new Process(); process.StartInfo.FileName = "cmd.exe"; process.StartInfo.UseShellExecute = false; //是否使用操作系统shell启动 process.StartInfo.RedirectStandardInput = true;//接受来自调用程序的输入信息 process.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息 process.StartInfo.RedirectStandardError = true;//重定向标准错误输出 process.StartInfo.CreateNoWindow = true;//不显示程序窗口 process.Start();//启动程序 process.OutputDataReceived += new DataReceivedEventHandler(OutputDataHandler); process.BeginOutputReadLine(); process.StandardInput.WriteLine(cmd); process.StandardInput.AutoFlush = true; process.StandardInput.WriteLine("exit"); process.WaitForExit();//等待程序执行完退出进程 foreach (Control control in gb_condition.Controls) { control.Enabled = true; } process.Close(); } private void OutputDataHandler(object sender, DataReceivedEventArgs e) { if (!string.IsNullOrEmpty(e.Data)) { //UpdateLog(e.Data); outDelegate.Invoke(e.Data); } } private void UpdateLog(string txt) { //if (tb_log.InvokeRequired) //{ // tb_log.Invoke(outDelegate, txt); //} //else //{ // this.tb_log.Text += txt + "\r\n"; //} this.tb_log.Text += txt + "\r\n"; } private void btn_clear_Click(object sender, EventArgs e) { tb_groupid.Text = null; tb_artifactid.Text = null; tb_version.Text = null; tb_packaging.Text = null; tb_file.Text = null; tb_command.Text = null; tb_log.Text = null; } } } ``` design文件 ``` namespace MavenInstall { partial class MavenInstall { /// <summary> /// 設計工具所需的變數。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清除任何使用中的資源。 /// </summary> /// <param name="disposing">如果應該處置受控資源則為 true,否則為 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form 設計工具產生的程式碼 /// <summary> /// 此為設計工具支援所需的方法 - 請勿使用程式碼編輯器修改 /// 這個方法的內容。 /// </summary> private void InitializeComponent() { this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.panel1 = new System.Windows.Forms.Panel(); this.btn_clear = new System.Windows.Forms.Button(); this.btn_execute = new System.Windows.Forms.Button(); this.gb_condition = new System.Windows.Forms.GroupBox(); this.tb_command = new System.Windows.Forms.TextBox(); this.btn_select = new System.Windows.Forms.Button(); this.lb_Command = new System.Windows.Forms.Label(); this.tb_file = new System.Windows.Forms.TextBox(); this.lb_File = new System.Windows.Forms.Label(); this.tb_packaging = new System.Windows.Forms.TextBox(); this.lb_Packaging = new System.Windows.Forms.Label(); this.tb_version = new System.Windows.Forms.TextBox(); this.lb_Version = new System.Windows.Forms.Label(); this.tb_artifactid = new System.Windows.Forms.TextBox(); this.lb_ArtifactId = new System.Windows.Forms.Label(); this.tb_groupid = new System.Windows.Forms.TextBox(); this.lb_GroupId = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.tb_log = new System.Windows.Forms.TextBox(); this.SelectJarFile = new System.Windows.Forms.OpenFileDialog(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.panel1.SuspendLayout(); this.gb_condition.SuspendLayout(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Margin = new System.Windows.Forms.Padding(4); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.panel1); this.splitContainer1.Panel1.Controls.Add(this.gb_condition); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.groupBox1); this.splitContainer1.Size = new System.Drawing.Size(1067, 372); this.splitContainer1.SplitterDistance = 348; this.splitContainer1.SplitterWidth = 5; this.splitContainer1.TabIndex = 0; // // panel1 // this.panel1.Controls.Add(this.btn_clear); this.panel1.Controls.Add(this.btn_execute); this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Location = new System.Drawing.Point(0, 328); this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(348, 44); this.panel1.TabIndex = 1; // // btn_clear // this.btn_clear.Location = new System.Drawing.Point(240, 8); this.btn_clear.Margin = new System.Windows.Forms.Padding(4); this.btn_clear.Name = "btn_clear"; this.btn_clear.Size = new System.Drawing.Size(100, 29); this.btn_clear.TabIndex = 0; this.btn_clear.Text = "Clear(&C)"; this.btn_clear.UseVisualStyleBackColor = true; this.btn_clear.Click += new System.EventHandler(this.btn_clear_Click); // // btn_execute // this.btn_execute.Location = new System.Drawing.Point(8, 8); this.btn_execute.Margin = new System.Windows.Forms.Padding(4); this.btn_execute.Name = "btn_execute"; this.btn_execute.Size = new System.Drawing.Size(97, 29); this.btn_execute.TabIndex = 0; this.btn_execute.Text = "Execute(&E)"; this.btn_execute.UseVisualStyleBackColor = true; this.btn_execute.Click += new System.EventHandler(this.btn_execute_Click); // // gb_condition // this.gb_condition.Controls.Add(this.tb_command); this.gb_condition.Controls.Add(this.btn_select); this.gb_condition.Controls.Add(this.lb_Command); this.gb_condition.Controls.Add(this.tb_file); this.gb_condition.Controls.Add(this.lb_File); this.gb_condition.Controls.Add(this.tb_packaging); this.gb_condition.Controls.Add(this.lb_Packaging); this.gb_condition.Controls.Add(this.tb_version); this.gb_condition.Controls.Add(this.lb_Version); this.gb_condition.Controls.Add(this.tb_artifactid); this.gb_condition.Controls.Add(this.lb_ArtifactId); this.gb_condition.Controls.Add(this.tb_groupid); this.gb_condition.Controls.Add(this.lb_GroupId); this.gb_condition.Dock = System.Windows.Forms.DockStyle.Fill; this.gb_condition.Location = new System.Drawing.Point(0, 0); this.gb_condition.Margin = new System.Windows.Forms.Padding(4); this.gb_condition.Name = "gb_condition"; this.gb_condition.Padding = new System.Windows.Forms.Padding(4); this.gb_condition.Size = new System.Drawing.Size(348, 372); this.gb_condition.TabIndex = 0; this.gb_condition.TabStop = false; this.gb_condition.Text = "Condition"; // // tb_command // this.tb_command.Location = new System.Drawing.Point(92, 196); this.tb_command.Margin = new System.Windows.Forms.Padding(4); this.tb_command.Multiline = true; this.tb_command.Name = "tb_command"; this.tb_command.ReadOnly = true; this.tb_command.Size = new System.Drawing.Size(247, 115); this.tb_command.TabIndex = 1; // // btn_select // this.btn_select.Location = new System.Drawing.Point(253, 161); this.btn_select.Margin = new System.Windows.Forms.Padding(4); this.btn_select.Name = "btn_select"; this.btn_select.Size = new System.Drawing.Size(87, 29); this.btn_select.TabIndex = 0; this.btn_select.Text = "Select(&S)"; this.btn_select.UseVisualStyleBackColor = true; this.btn_select.Click += new System.EventHandler(this.btn_select_Click); // // lb_Command // this.lb_Command.AutoSize = true; this.lb_Command.Location = new System.Drawing.Point(12, 202); this.lb_Command.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lb_Command.Name = "lb_Command"; this.lb_Command.Size = new System.Drawing.Size(69, 15); this.lb_Command.TabIndex = 0; this.lb_Command.Text = "Command:"; // // tb_file // this.tb_file.Location = new System.Drawing.Point(92, 161); this.tb_file.Margin = new System.Windows.Forms.Padding(4); this.tb_file.Name = "tb_file"; this.tb_file.Size = new System.Drawing.Size(152, 25); this.tb_file.TabIndex = 1; // // lb_File // this.lb_File.AutoSize = true; this.lb_File.Location = new System.Drawing.Point(55, 168); this.lb_File.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lb_File.Name = "lb_File"; this.lb_File.Size = new System.Drawing.Size(33, 15); this.lb_File.TabIndex = 0; this.lb_File.Text = "File:"; // // tb_packaging // this.tb_packaging.Location = new System.Drawing.Point(92, 126); this.tb_packaging.Margin = new System.Windows.Forms.Padding(4); this.tb_packaging.Name = "tb_packaging"; this.tb_packaging.Size = new System.Drawing.Size(247, 25); this.tb_packaging.TabIndex = 1; // // lb_Packaging // this.lb_Packaging.AutoSize = true; this.lb_Packaging.Location = new System.Drawing.Point(13, 132); this.lb_Packaging.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lb_Packaging.Name = "lb_Packaging"; this.lb_Packaging.Size = new System.Drawing.Size(69, 15); this.lb_Packaging.TabIndex = 0; this.lb_Packaging.Text = "Packaging:"; // // tb_version // this.tb_version.Location = new System.Drawing.Point(92, 91); this.tb_version.Margin = new System.Windows.Forms.Padding(4); this.tb_version.Name = "tb_version"; this.tb_version.Size = new System.Drawing.Size(247, 25); this.tb_version.TabIndex = 1; // // lb_Version // this.lb_Version.AutoSize = true; this.lb_Version.Location = new System.Drawing.Point(29, 98); this.lb_Version.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lb_Version.Name = "lb_Version"; this.lb_Version.Size = new System.Drawing.Size(55, 15); this.lb_Version.TabIndex = 0; this.lb_Version.Text = "Version:"; // // tb_artifactid // this.tb_artifactid.Location = new System.Drawing.Point(92, 56); this.tb_artifactid.Margin = new System.Windows.Forms.Padding(4); this.tb_artifactid.Name = "tb_artifactid"; this.tb_artifactid.Size = new System.Drawing.Size(247, 25); this.tb_artifactid.TabIndex = 1; // // lb_ArtifactId // this.lb_ArtifactId.AutoSize = true; this.lb_ArtifactId.Location = new System.Drawing.Point(17, 62); this.lb_ArtifactId.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lb_ArtifactId.Name = "lb_ArtifactId"; this.lb_ArtifactId.Size = new System.Drawing.Size(67, 15); this.lb_ArtifactId.TabIndex = 0; this.lb_ArtifactId.Text = "ArtifactId:"; // // tb_groupid // this.tb_groupid.Location = new System.Drawing.Point(92, 21); this.tb_groupid.Margin = new System.Windows.Forms.Padding(4); this.tb_groupid.Name = "tb_groupid"; this.tb_groupid.Size = new System.Drawing.Size(247, 25); this.tb_groupid.TabIndex = 1; // // lb_GroupId // this.lb_GroupId.AutoSize = true; this.lb_GroupId.Location = new System.Drawing.Point(24, 26); this.lb_GroupId.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lb_GroupId.Name = "lb_GroupId"; this.lb_GroupId.Size = new System.Drawing.Size(59, 15); this.lb_GroupId.TabIndex = 0; this.lb_GroupId.Text = "GroupId:"; // // groupBox1 // this.groupBox1.Controls.Add(this.tb_log); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(4); this.groupBox1.Size = new System.Drawing.Size(714, 372); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "Log"; // // tb_log // this.tb_log.Dock = System.Windows.Forms.DockStyle.Fill; this.tb_log.Location = new System.Drawing.Point(4, 22); this.tb_log.Margin = new System.Windows.Forms.Padding(4); this.tb_log.Multiline = true; this.tb_log.Name = "tb_log"; this.tb_log.ReadOnly = true; this.tb_log.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.tb_log.Size = new System.Drawing.Size(706, 346); this.tb_log.TabIndex = 0; // // SelectJarFile // this.SelectJarFile.FileName = "SelectJarFile"; // // MavenInstall // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1067, 372); this.Controls.Add(this.splitContainer1); this.Margin = new System.Windows.Forms.Padding(4); this.Name = "MavenInstall"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "MavenInstall"; this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.gb_condition.ResumeLayout(false); this.gb_condition.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button btn_clear; private System.Windows.Forms.Button btn_execute; private System.Windows.Forms.GroupBox gb_condition; private System.Windows.Forms.TextBox tb_command; private System.Windows.Forms.Button btn_select; private System.Windows.Forms.Label lb_Command; private System.Windows.Forms.TextBox tb_file; private System.Windows.Forms.Label lb_File; private System.Windows.Forms.TextBox tb_packaging; private System.Windows.Forms.Label lb_Packaging; private System.Windows.Forms.TextBox tb_version; private System.Windows.Forms.Label lb_Version; private System.Windows.Forms.TextBox tb_artifactid; private System.Windows.Forms.Label lb_ArtifactId; private System.Windows.Forms.TextBox tb_groupid; private System.Windows.Forms.Label lb_GroupId; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TextBox tb_log; private System.Windows.Forms.OpenFileDialog SelectJarFile; } } ```
C#中窗口值传递的问题咨询
Form1(方案一): private void TextBox1_Click(object sender, EventArgs e) { FrmHotKey f2 = new FrmHotKey(); f2.Form2Value = "Ok"; //给Form2的textBox1赋值初始Ok f2.Show(); } private void button3_Click(object sender, EventArgs e) { FrmHotKey f2 = new FrmHotKey();//改变Form2的textBox1赋值初始Ok f2.Form2Value = "Owwk"; } Form1(方案二): FrmHotKey f2 = new FrmHotKey(); private void TextBox1_Click(object sender, EventArgs e) { f2.Form2Value = "Ok"; //给Form2的textBox1赋值初始Ok f2.Show(); } private void button3_Click(object sender, EventArgs e) { //改变Form2的textBox1赋值初始Ok f2.Form2Value = "Owwk"; } Form2中: public string Form2Value { get { return this.label3.Text; } set { Sts = value; } } 第一种方案不能正确的把修改后的值传递给Sts,第二种方案可以。请问一下这是为什么。我希望能在 form2里面实施更新form1传递的数据,有更好的方案请提供一下。
C#数据库操作问题小白一枚
取textbox里面八种设定的值,对比QGLGame数据库Character表里对应的字段值,任意一种字段如果超过设定值。则取对应数据的acct_id字段的值,到另一个QGLAccount数据库里Account表bantime字段写入2000-12-12 12:12:12 每五分钟循环监控一次上面过程!求大神帮忙谢谢了!! private void button1_Click(object sender, EventArgs e)//开始网关 { { SqlConnection conn; string SqlStr = ConfigurationManager.ConnectionStrings["SqlConnString"].ConnectionString; conn = new SqlConnection(SqlStr);//实例化SqlConnection数据库连接对象 conn.Open();//打开数据库连接 if (conn.State == ConnectionState.Open)//判断连接是否打开 { label1.Text = "网关运行状态:已启动"; } } ``` ``` ![图片说明](https://img-ask.csdn.net/upload/201810/16/1539691405_509895.jpg) ![图片说明](https://img-ask.csdn.net/upload/201810/16/1539691413_551957.jpg) ![图片说明](https://img-ask.csdn.net/upload/201810/16/1539691422_317688.jpg) ![图片说明](https://img-ask.csdn.net/upload/201810/16/1539691445_169057.png)
C# 电池控件 用于VS2015的windows窗口
刚开始学C#,需要一个可以在VS2015使用的windows窗口电池控件,就是类似于手机 上显示电池电量的那种,可以像类似textbox,label等其他控件可以直接拖拽到windows 窗口上的。 哪位师傅有的麻烦给我发一下,不胜感激! 827104653@qq.com
求教一个C#小程序挺急的。
登录窗体就是用户名密码两个label,两个textbox两个button。完全没思路。
C#中的问题请指教,看图!
在textbox3中输入数字,label11中显示该数字,在textbox3中其他数字,label11中累加?请问怎么改?![图片](https://img-ask.csdn.net/upload/201512/23/1450852624_106118.jpg)![图片](https://img-ask.csdn.net/upload/201512/23/1450852675_878243.jpg)
C#简单程序问题,初学者请大家指教
textbox1中输入一个数字,点击确定按钮,label1中显示输入的数字,再次在textbox1中输入其他数字label中累加,请问这个程序代码怎么写?在textbox1中只能输入数字,这个代码是什么?
c# webbrowser 自动选择 radio问题
我想选中radio中指定选项,可是代码没生效,大家帮我看看哪里的问题呗 我的代码。外面的循环已经能够定位到指定题目,得到name,然后我用 ele.SetAttribute("checked", "checked");或者H_timu.SetAttribute("value", "RadioButton1");都不能选中指定选项。 ``` string subtext = alltext.Substring(a, 400); int b = subtext.IndexOf("name="); string timuname = subtext.Substring(b+5,18); HtmlElement H_timu = webBrowser1.Document.All[timuname]; textBox4.Text += timuname; H_timu.SetAttribute("value", "RadioButton1"); /* foreach (HtmlElement ele in webBrowser1.Document.GetElementsByTagName(timuname)) { textBox4.Text += "0"; if (ele.GetAttribute("value") == "RadioButton1") { ele.SetAttribute("checked", "checked"); } } */ ``` 网页radio内容,这里只列举一个,我已经实现了题目的定为, A:<input id="GridView1_ctl17_RadioButton1" type="radio" name="GridView1$ctl17$Sl" value="RadioButton1" /><label for="GridView1_ctl17_RadioButton1">A. which  </label> B:<input id="GridView1_ctl17_RadioButton2" type="radio" name="GridView1$ctl17$Sl" value="RadioButton2" /><label for="GridView1_ctl17_RadioButton2">B. with whom  </label> C:<input id="GridView1_ctl17_RadioButton3" type="radio" name="GridView1$ctl17$Sl" value="RadioButton3" /><label for="GridView1_ctl17_RadioButton3">C. whom  </label> D:<input id="GridView1_ctl17_RadioButton4" type="radio" name="GridView1$ctl17$Sl" value="RadioButton4" /><label for="GridView1_ctl17_RadioButton4">D. with which</label>
C# winform 如何使用两个点击来触发一个事件?
留学狗作业做不出来!老师要求,有一个球队名单显示在主窗口,同时旁边附有三个按钮:修改,新增,删除。当选中一个球队,选中项会高亮,然后再选中旁边按钮选项,跳出另一个窗口做重命名或者修改的任务。 初学者:老师只教了label,textbox,button功能。
关于c#的dr.Close();放哪里好?
cn.ConnectionString = "server = (local);password = 123;uid = sa;database = keshe"; cn.Open(); SqlCommand cmd_jiage = new SqlCommand("select 出租价格 from 房屋表", cn); SqlDataReader dr = cmd_jiage.ExecuteReader(); while (dr.Read()) { if (dr["出租价格"].ToString().Trim() == TextBox1.Text) { SqlCommand cmd = new SqlCommand("select * from 房屋表 where 出租价格 = @jiage", cn); cmd.Parameters.Add("@jiage", TextBox1.Text); GridView1.DataSource = cmd.ExecuteReader(); GridView1.DataBind(); } else { Label1.Text = "asd"; } dr.Close(); } cn.Close();
c#异步通讯五子棋 双方倒计时怎么写
我用c#异步通讯做了个五子棋的winform,服务器端和客户端分开的。想利用timer实现双方倒计时要怎么写? client端代码 ``` using System; using System.Drawing; using System.Windows.Forms; using System.IO; namespace GameClient { public partial class FormPlaying : Form { private int tableIndex; private int side; private DotColor[,] grid = new DotColor[15, 15]; //保存颜色,用于消点时进行判断 private Bitmap blackBitmap; private Bitmap whiteBitmap; //命令是否来自服务器 private bool isReceiveCommand = false; private Service service; delegate void LabelDelegate(Label label, string str); delegate void ButtonDelegate(Button button, bool flag); delegate void RadioButtonDelegate(RadioButton radioButton, bool flag); delegate void SetDotDelegate(int i, int j, int dotColor); LabelDelegate labelDelegate; ButtonDelegate buttonDelegate; RadioButtonDelegate radioButtonDelegate; public FormPlaying(int TableIndex, int Side, BinaryWriter bw) { InitializeComponent(); this.tableIndex = TableIndex; this.side = Side; labelDelegate = new LabelDelegate(SetLabel); buttonDelegate = new ButtonDelegate(SetButton); radioButtonDelegate = new RadioButtonDelegate(SetRadioButton); blackBitmap = new Bitmap(Properties.Resources.black); whiteBitmap = new Bitmap(Properties.Resources.white); service = new Service(listBox1, bw); } /// <summary>载入窗体时发生的事件</summary> private void FormPlaying_Load(object sender, EventArgs e) { //默认游戏级别为3级 radioButton3.Checked = true; for (int i = 0; i <= grid.GetUpperBound(0); i++) { for (int j = 0; j <= grid.GetUpperBound(1); j++) { grid[i, j] = DotColor.None; } } labelSide0.Text = ""; labelSide1.Text = ""; labelGrade0.Text = ""; labelGrade1.Text = ""; } /// <summary>设置标签显示信息</summary> /// <param name="Label">要设置的Label</param> /// <param name="string">要设置的信息</param> public void SetLabel(Label label, string str) { if (label.InvokeRequired) { this.Invoke(labelDelegate, label, str); } else { label.Text = str; } } /// <summary>设置button是否可用</summary> /// <param name="Button">要设置的Button</param> /// <param name="flag">是否可用</param> private void SetButton(Button button, bool flag) { if (button.InvokeRequired) { this.Invoke(buttonDelegate, button, flag); } else { button.Enabled = flag; } } /// <summary>设置radioButton选择状态</summary> /// <param name="radioButton">要设置的RadioButton</param> /// <param name="flag">是否选中</param> private void SetRadioButton(RadioButton radioButton, bool flag) { if (radioButton.InvokeRequired) { this.Invoke(radioButtonDelegate, radioButton, flag); } else { radioButton.Checked = flag; } } /// <summary>设置棋子状态</summary> /// <param name="i">第几行</param> /// <param name="j">第几列</param> /// <param name="dotColor">棋子颜色</param> //public void SetDot(int i, int j, DotColor dotColor) //{ // service.AddItemToListBox(string.Format("{0},{1},{2}", i, j, dotColor)); // grid[i, j] = dotColor; // pictureBox1.Invalidate(); //} /// <summary>重新开始新游戏</summary> /// <param name="str">警告信息</param> public void Restart(string str) { MessageBox.Show(str, "", MessageBoxButtons.OK, MessageBoxIcon.Warning); ResetGrid(); SetButton(buttonStart, true); } /// <summary>重置棋盘</summary> private void ResetGrid() { SetLabel(labelGrade0, ""); SetLabel(labelGrade1, ""); for (int i = 0; i <= grid.GetUpperBound(0); i++) { for (int j = 0; j <= grid.GetUpperBound(1); j++) { grid[i, j] = DotColor.None; } } pictureBox1.Invalidate(); } /// <summary>取消棋子</summary> /// <param name="x">x坐标</param> /// <param name="y">y坐标</param> public void UnsetDot(int x, int y,DotColor dotColor) { //service.AddItemToListBox(string.Format("{0},{1},{2}", i, j, dotColor)); //grid[x / 20 - 1, y / 20 - 1] = dotColor; grid[x,y] = dotColor; pictureBox1.Invalidate(); } /// <summary>绘制图像</summary> private void pictureBox1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; for (int i = 0; i <= grid.GetUpperBound(0); i++) { for (int j = 0; j <= grid.GetUpperBound(1); j++) { if (grid[i, j] != DotColor.None) { if (grid[i, j] == DotColor.Black) { g.DrawImage(blackBitmap, (i + 1) * 20, (j + 1) * 20); } else { g.DrawImage(whiteBitmap, (i + 1) * 20, (j + 1) * 20); } } } } } /// <summary>设置游戏难度级别</summary> /// <param name="ss">难度级别</param> public void SetLevel(string ss) { isReceiveCommand = true; switch (ss) { case "1": SetRadioButton(radioButton1, true); break; case "2": SetRadioButton(radioButton2, true); break; case "3": SetRadioButton(radioButton3, true); break; case "4": SetRadioButton(radioButton4, true); break; case "5": SetRadioButton(radioButton5, true); break; } isReceiveCommand = false; } /// <summary>当游戏难度级别发生变化时触发的事件</summary> private void radioButton_CheckedChanged(object sender, EventArgs e) { //isReceiveCommand为true表明是接收服务器设置的难度级别触发的此事件 //就不需要再向服务器发送 if (isReceiveCommand == false) { RadioButton radiobutton = (RadioButton)sender; if (radiobutton.Checked == true) { //设置难度级别 //格式:Time,桌号,难度级别 service.SendToServer(string.Format("Level,{0},{1}",tableIndex, radiobutton.Name[radiobutton.Name.Length - 1])); } } } /// <summary>向服务器发送消息</summary> private void buttonSend_Click(object sender, EventArgs e) { //字符串格式:Talk,桌号,对话内容 service.SendToServer(string.Format("Talk,{0},{1}", tableIndex, textBox1.Text)); } /// <summary>对话内容改变时触发的事件</summary> private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { //字符串格式:Talk,桌号,对话内容 service.SendToServer(string.Format("Talk,{0},{1}", tableIndex, textBox1.Text)); } } /// <summary>点击帮助按钮时触发的事件</summary> private void buttonHelp_Click(object sender, EventArgs e) { string str = "\n本游戏每两人为一组。游戏玩法:\n\n" + "(1)对局双方各执一色棋子。\n\n"+ "(2)空棋盘开局。\n\n" + "(3)黑先、白后,交替下子,每次只能下一子。\n\n" + "(4)只要黑白方中任意一方的棋子有五子连在一起(即五子连珠),可以为横连、纵连、斜连,则该方获胜。\n"; MessageBox.Show(str, "帮助信息"); } /// <summary>点击开始按钮时触发的事件</summary> private void buttonStart_Click(object sender, EventArgs e) { service.SendToServer(string.Format("Start,{0},{1}", tableIndex, side)); this.buttonStart.Enabled = false; } /// <summary>点击退出按钮时触发的事件</summary> private void buttonExit_Click(object sender, EventArgs e) { this.Close(); } /// <summary>关闭窗体时触发的事件</summary> private void FormPlaying_FormClosing(object sender, FormClosingEventArgs e) { //格式:GetUp,桌号,座位号 service.SendToServer(string.Format("GetUp,{0},{1}", tableIndex, side)); } /// <summary>FormRoom中的线程调用此方法关闭此窗体</summary> public void StopFormPlaying() { Application.Exit(); } /// <summary>在pictureBox1中按下鼠标触发的事件</summary> private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { int x = e.X / 20; int y = e.Y / 20; int color=-1; if (!(x < 1 || x > 15 || y < 1 || y > 15)) { if (grid[x - 1, y - 1] == DotColor.None) { // int color = (int)grid[x - 1, y - 1]; if (side == 0) { color = 0; } if (side == 1) { color = 1; } //发送格式:UnsetDot,桌号,座位号,行,列,颜色 service.SendToServer(string.Format( "UnsetDot,{0},{1},{2},{3},{4}", tableIndex, side, x - 1, y - 1, color)); } } } /// <summary> /// 设置玩家信息,格式:座位号,labelSide显示的信息,listbox显示的信息 /// </summary> /// <param name="sideString">指定玩家</param> /// <param name="labelSideString">labelSide显示的信息</param> /// <param name="listBoxString">listbox显示的信息</param> public void SetTableSideText(string sideString, string labelSideString, string listBoxString) { string s = "白方"; if (sideString == "0") { s = "黑方:"; } //判断自己是黑方还是白方 if (sideString == side.ToString()) { SetLabel(labelSide1, s + labelSideString); } else { SetLabel(labelSide0, s + labelSideString); } service.AddItemToListBox(listBoxString); } /// <summary> /// 设置成绩信息,格式:grade0为黑方成绩,grade1为白方成绩 /// </summary> /// <param name="str0">黑方成绩信息</param> /// <param name="str1">白方成绩信息</param> public void SetGradeText(string str0, string str1) { if (side == (int)DotColor.Black) { SetLabel(labelGrade1, str0); SetLabel(labelGrade0, str1); } else { SetLabel(labelGrade0, str0); SetLabel(labelGrade1, str1); } } /// <summary>显示谈话信息</summary> /// <param name="talkMan">谈话者</param> /// <param name="str">要显示的信息</param> public void ShowTalk(string talkMan, string str) { service.AddItemToListBox(string.Format("{0}说:{1}", talkMan, str)); } /// <summary> /// 显示消息 /// </summary> /// <param name="str">要显示的消息</param> public void ShowMessage(string str) { service.AddItemToListBox(str); } } } ``` service方法代码 ``` //------Service.cs----------// using System.Windows.Forms; using System.IO; using System.Net; using System.Net.Sockets; using System; using System.Threading; namespace GameClient { class Service { ListBox listbox; //StreamWriter sw; BinaryWriter bw; bool isExit = false; public Service(ListBox listbox, BinaryWriter bw) { this.listbox = listbox; this.bw = bw; } private struct SendToServerStates { public SendToServerDelegate d; public IAsyncResult result; } /// <summary>异步向服务器端发送数据</summary> public void AsyncSendToServer(string message) { SendToServerDelegate d = new SendToServerDelegate(SendToServer); IAsyncResult result = d.BeginInvoke(message, null, null); while (result.IsCompleted == false) { if (isExit) { return; } Thread.Sleep(50); } SendToServerStates states = new SendToServerStates(); states.d = d; states.result = result; Thread t = new Thread(FinishAsyncSendToServer); t.IsBackground = true; t.Start(states); } /// <summary>处理接收的服务器端数据</summary> private void FinishAsyncSendToServer(object obj) { SendToServerStates states = (SendToServerStates)obj; states.d.EndInvoke(states.result); } delegate void SendToServerDelegate(string message); /// <summary>向服务器发送数据</summary> public void SendToServer(string str) { try { bw.Write(str); bw.Flush(); } catch { AddItemToListBox("发送数据失败"); } } delegate void ListBoxDelegate(string str); /// <summary>在listbox中追加信息<</summary> /// <param name="str">要追加的信息</param> public void AddItemToListBox(string str) { if (listbox.InvokeRequired) { ListBoxDelegate d = AddItemToListBox; listbox.Invoke(d, str); } else { listbox.Items.Add(str); listbox.SelectedIndex = listbox.Items.Count - 1; listbox.ClearSelected(); } } } } ```
C#从Datagridview中读取某列的所有字符,并拼接成一个字符
`StringBuilder detail = new StringBuilder(""); string f10username; string f10number; public void button1_Click(object sender, EventArgs e) { if (a + b + c + d == 4) { for (int i = 0; i < this.dataGridView1.Rows.Count; i++) { f10username = this.dataGridView1.Rows[i].Cells[1].Value.ToString(); f10number = this.dataGridView1.Rows[i].Cells[9].Value.ToString(); detail.Append("图书编号" + f10username + "有" + f10number + "本;\n"); } Form11 f11 = new Form11(this.label2 .Text ,this .nameform10,this .textBox1 .Text ,this .textBox2 .Text ,this .textBox3.Text ,this .comboBox1 .Text ,this .datetime,this.detail .ToString (),this.label10 .Text ); f11 .ShowDialog (); } }`` ``` 这是我自己写的,但是报错,求大神指点
C#网页问题:未将对象引用到实例
我想在.CS当中简单地引用.aspx中的一个TextBox控件,但是就是死活不成功。 下面是源码: .cs: ``` protected void chengji_Click(object sender, EventArgs e) { for (int i = 0; i < this.gv_chengji.Rows.Count; i++) { TextBox box = this.gv_chengji.Rows[i].FindControl("TextBox2") as TextBox; string text = this.gv_chengji.Rows[i].Cells[1].Text; this.update(text, box.Text); } TextBox TextBox3 = this.FindControl("TextBox3") as TextBox; TextBox TextBox4 = this.FindControl("TextBox4") as TextBox; TextBox TextBox5 = this.FindControl("TextBox5") as TextBox; string year = TextBox3.Text.ToString(); string month = TextBox4.Text.ToString(); string day = TextBox5.Text.ToString(); } ``` .aspx: ``` <%@ page title="" language="C#" masterpagefile="~/MasterPage/MasterPage.master" autoeventwireup="true" inherits="ResultManage_Resultin, App_Web_resultin.aspx.ce51174c" enableeventvalidation="false" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <table width="800"> <tr> <td width="80" height="30">队别:</td> <td width="80"> <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList2_SelectedIndexChanged"> </asp:DropDownList> </td> <td width="80"> <asp:Label ID="Label2" runat="server" Text="比赛项目:"></asp:Label> </td> <td width="80" align="center" colspan="2"> <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList> </td> <td width="80" align="center"> <asp:Button ID="chengji" runat="server" OnClick="chengji_Click" Text="保存更改" Width="66px" /> </td> <td width="80" colspan="2"> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="导出成绩表(.xls)" Style="margin-left: 0px" Width="122px" /> </td> <td width="80" colspan="2"> <asp:Button ID="Button12" runat="server" OnClick="Button12_Click" Text="生成成绩表(.doc)" Width="117px" /> </td> <td> <asp:Button ID="Button13" runat="server" OnClick="Button13_Click" Text="导出成绩表(.doc)" Width="117px" /> </td> </tr> <table> <tr height="20"> <td >录入时间: </td> <td > <asp:TextBox ID="TextBox3" runat="server" Width="45px" ></asp:TextBox> <asp:Label ID="Label3" runat="server" Text="年" Width="15px"></asp:Label> </td> <td > <asp:TextBox ID="TextBox4" runat="server" Width="45px" ></asp:TextBox> <asp:Label ID="Label4" runat="server" Text="月" Width="15px"></asp:Label> </td> <td > <asp:TextBox ID="TextBox5" runat="server" Width="45px" ></asp:TextBox> <asp:Label ID="Label5" runat="server" Text="日" Width="15px"></asp:Label> </td> </tr> <table> </tr> <%--<tr><td colspan ="10" height="20"> <iframe src="../ResultManage/ProgressBar.htm" name="RightFrame" frameborder="no" scrolling="no" height="20" style="width: 383px"></iframe></td></tr> <tr>--%> <tr> <td colspan="12" align="center"> <asp:GridView ID="gv_chengji" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" GridLines="Horizontal" AllowPaging="True" OnPageIndexChanging="gv_chengji_PageIndexChanging1" OnRowCommand="gv_chengji_RowCommand"> <Columns> <asp:TemplateField HeaderText="序号"> <ItemTemplate> <asp:Literal ID="Literal1" runat="server" Text="<%# Container.DataItemIndex+1 %>"></asp:Literal> </ItemTemplate> </asp:TemplateField> <%--<asp:ImageField DataImageUrlField="score" HeaderText="照片" NullImageUrl="~/Image/red/1402003.jpg"> <ControlStyle Height="80px" Width="60px" /> </asp:ImageField>--%> <asp:BoundField DataField="ID" HeaderText="学号" ReadOnly="True" SortExpression="学号" /> <asp:BoundField DataField="name" HeaderText="姓名" ReadOnly="True" SortExpression="姓名" /> <asp:BoundField DataField="sex" HeaderText="性别" ReadOnly="True" SortExpression="性别" /> <asp:BoundField DataField="level" HeaderText="层次" ReadOnly="True" SortExpression="层次" /> <asp:BoundField DataField="Big_unit" HeaderText="大单位" ReadOnly="True" SortExpression="大单位" /> <asp:BoundField DataField="unit" HeaderText="小单位" ReadOnly="True" SortExpression="小单位" /> <asp:BoundField DataField="year" HeaderText="入学年份" ReadOnly="True" SortExpression="入学年份" /> <%--<asp:BoundField DataField="event_num" HeaderText="竞赛编号" ReadOnly="True" SortExpression="竞赛编号" />--%> <asp:BoundField DataField="compevent" HeaderText="竞赛名称" ReadOnly="True" SortExpression="竞赛名称" /> <asp:TemplateField HeaderText="比赛成绩" SortExpression="比赛成绩"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("score") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:TextBox ID="TextBox2" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"score") %>'></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> <PagerTemplate> <br/> <asp:Label ID="lblPage1" runat="Server" Text='<%# "第" +( ((GridView)Container.NamingContainer).PageIndex +1 ) +"页/共"+ (((GridView)Container.NamingContainer).PageCount) +"页" %>'></asp:Label> <asp:LinkButton ID="lbnFirst1" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First"></asp:LinkButton> <asp:LinkButton ID="lbnPrev1" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev"></asp:LinkButton> <asp:LinkButton ID="lbnNext1" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next"></asp:LinkButton> <asp:LinkButton ID="lbnLast1" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last"></asp:LinkButton> 到第<asp:TextBox runat="server" ID="inPageNum1" Width="10mm"></asp:TextBox>页 <asp:Button ID="Button11" CommandName="go" Text="转到" runat="server" /> <br /> </PagerTemplate> <FooterStyle BackColor="White" ForeColor="#333333" /> <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="White" ForeColor="#333333" /> <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" /> <SortedAscendingCellStyle BackColor="#F7F7F7" /> <SortedAscendingHeaderStyle BackColor="#487575" /> <SortedDescendingCellStyle BackColor="#E5E5E5" /> <SortedDescendingHeaderStyle BackColor="#275353" /> </asp:GridView> </td> </tr> </table> </asp:Content> ``` 已经调试过了,在chengji_click函数中,三条定义string的语句老是报错“未将对象引用到实例”,到底是为什么啊???大神救命啊!!!
C#函数调用结果为什么不对
这是学生类。 class Student { public string id; public string name; public double chinese; public double math; public double english; public Student() { } public Student(string id,string name,double chinese,double math,double english) { this.id = id; this.name = name; this.chinese = chinese; this.math = math; this.english = english; } public string Id { set { this.id = value; } get{return this.id ;} } public string Name { set { this.name = value; } get { return this.name; } } public double Chinese { set { this.chinese = value; } get { return this.chinese; } } public double Math { set { this.math = value; } get { return this.math; } } public double English { set { this.english = value; } get { return this .english ;} } public double Total{ get { return chinese + math + english; } } } 这是Grade类 class Grade { public Student[] students = new Student[3]; public int n; public Grade () { n = 0; } public void add(Student s) { students[n] = s; n++; } public int search(string name) { int i; for ( i=0;i<n;i++) { if (students[i].name == name) break; } if (i == n) return -1; else return i; } public void sort() { for(int i=0;i<n;i++) { int k = i; for (int j = i + 1; j < n; j++) if (students[j].Total > students[k].Total) k = j; if (k != i) { Student temp; temp = students[k]; students[k] = students[i]; students[i] = temp; } } } private string getMaxer1() { int max1 = 0; for (int i = 1; i < n; i++) if (students[i].chinese > students[max1].chinese) max1= i; return students[max1].chinese+","+students[max1].name; } private string getMaxer2() { int max2 = 0; for (int i = 1; i < n; i++) if (students[i].math > students[max2].math) max2 = i; return students[max2].chinese + "," + students[max2].name; } private string getMaxer3() { int max3 = 0; for (int i = 1; i < n; i++) if (students[i].english > students[max3].english) max3 = i; return students[max3].chinese + "," + students[max3].name; } private string getLoser1() { string result = ""; for (int i = 0; i < n; i++) { students[i] = new Student(); if (students[i].chinese < 60) result += students[i].name + "\n"; } return result; } private string getLoser2() { string result = ""; for (int i = 0; i < n; i++) { students[i] = new Student(); if (students[i].math < 60) result += students[i].name + "\n";} return result; } private string getLoser3() { string result = ""; for (int i = 0; i < n; i++) { students[i] = new Student(); if (students[i].english < 60) result += students[i].name + "\n"; } return result; } public string getMaxerAndLoser() { string Maxer = "", Loser = ""; Maxer += "单科语文最高:" + getMaxer1() + "\n"; Maxer += "单科数学最高:" + getMaxer2() + "\n"; Maxer += "单科英语最高:" + getMaxer3() + "\n"; Loser += "单科语文挂科名单:" + getLoser1() + "\n"; Loser += "单科数学挂科名单:" + getLoser2() + "\n"; Loser += "单科英语挂科名单:" + getLoser3() + "\n"; return Maxer + "\n" + Loser; } public string all() { double allave = 0, all = 0; for(int i=0;i<3;i++) { students[i] = new Student(); all = students[i].chinese + students[i].math + students[i].english; allave = allave + all; } return "平均成绩为:" + allave / n; } public double jige1() { double w = 0.0; for (int i = 0; i < 3; i++) { students[i] = new Student(); if (students[i].chinese > 60) w += 1.0; } return w/n; } public double jige2() {double w = 0.0; for (int i = 0; i < n; i++) { students[i] = new Student(); if (students[i].math > 60) w += 1.0; } return w/n; } public double jige3() { double w = 0.0; for (int i = 0; i < 3; i++) { students[i] = new Student(); if (students[i].english > 60) w += 1.0; } return w / n; } public string jigelv() { string pass = ""; pass += "语文及格率为:" + jige1() + "\n"; pass += "数学及格率为:" + jige2() + "\n"; pass += "英语及格率为:" + jige3() + "\n"; return pass; } } } 这是主函数 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; namespace P111实验3 { public partial class Form1 : Form { Student[] students = new Student[3]; Grade ss = new Grade(); int n=0; public Form1() { InitializeComponent(); } int i = 0; private void button1_Click(object sender, EventArgs e) { students[i] = new Student();//创建对象 students[i].id = textBox1.Text; students[i].name = textBox2.Text; students[i].chinese = Convert.ToDouble(textBox3.Text); students[i].math = Convert.ToDouble(textBox4.Text); students[i].english = Convert.ToDouble(textBox5.Text); // n++; // ss.add(); label7.Text = "已成功添加一个学生!此学生信息为:"; label7.Text += "学号:" + students[i].id + ",姓名:" + students[i].name + ",语文成绩:" + students[i].chinese + ",数学成绩:" + students[i].math + ",英语成绩:" + students[i].english; label7.Text += "总成绩为:" + (students[i].chinese + students[i].math + students[i].english)+"\n"; i ++; } private void button2_Click(object sender, EventArgs e) { foreach(Student c in students){ label7.Text = "学号:" + c.id + ",姓名:" +c.name + ",语文成绩:" + c.chinese + ",数学成绩:" + c.math + ",英语成绩:" + c.english; label7.Text += "总成绩为:" + (c.chinese + c.math + c.english)+"\n"; } label7.Text += ""; ss.sort(); label7.Text += ss.getMaxerAndLoser(); label7.Text += ss.all()+"\n"; label7.Text += ss.jige1(); label7.Text += ss.jige2(); label7.Text += ss.jige3(); label7.Text += ss.jigelv(); } private void button3_Click(object sender, EventArgs e) { // label7.Text = ss.search(); } } } 结果为截图2.这是怎么回事?谢谢谢谢![图片说明](https://img-ask.csdn.net/upload/201710/21/1508547741_548128.png)
请问C#windows窗体代码哪儿错了?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace P111实验3 { class Student { private string id; private string name; private double chinese; private double math; private double english; public Student(string id,string name,double chinese,double math,double english) { this.id = id; this.name = name; this.chinese = chinese; this.math = math; this.english = english; } public string Id { set { this.id = value; } get{return this.id ;} } public string Name { set { this.name = value; } get { return this.name; } } public double Chinese { set { this.chinese = value; } get { return this.chinese; } } public double Math { set { this.math = value; } get { return this.math; } } public double English { set { this.english = value; } get { return this .english ;} } public double Total{ get { return chinese + math + english; } } } } s.id = textBox1.Text; s.name = textBox2.Text; s.chinese = Convert.ToDouble(textBox3.Text); s.math = Convert.ToDouble(textBox4.Text); s.english = Convert.ToDouble(textBox5.Text); n++; label7.Text = "已成功添加一个学生!此学生信息为:"; lable7.text += "学号:" + this.id + "姓名:" + this.name + "语文成绩:" + this.chinese + "数学成绩:" + this.math + "英语成绩:" + this.english; } } 最后这一段代码s.id, s.name, s.chinese, s.math, s.english有错为什么呢?谢谢 错误 1 “System.Array”不包含“id”的定义,并且找不到可接受类型为“System.Array”的第一个参数的扩展方法“id”(是否缺少 using 指令或程序集引用?) 错误 2 “System.Array”不包含“name”的定义,并且找不到可接受类型为“System.Array”的第一个参数的扩展方法“name”(是否缺少 using 指令或程序集引用?) 错误 3 “System.Array”不包含“chinese”的定义,并且找不到可接受类型为“System.Array”的第一个参数的扩展方法“chinese”(是否缺少 using 指令或程序集引用?) 错误 4 “System.Array”不包含“math”的定义,并且找不到可接受类型为“System.Array”的第一个参数的扩展方法“math”(是否缺少 using 指令或程序集引用?) 错误 5 “System.Array”不包含“english”的定义,并且找不到可接受类型为“System.Array”的第一个参数的扩展方法“english”(是否缺少 using 指令或程序集引用?)
求助 ,关于C# winform窗体串口在读取一组参数后再一次读取另一组参数的问题
有两个按钮,一个是“开启基本数据按钮设为button1”,另一个是“读取ListBox内部 数据的内容“设为button2,设定是先开启button1接收基本数据后才能开启button2接 收ListBox内的数据,接收协议一共有5位,分别是报头,符号位,数据位,数据位,校验位(没有长度位),当开启button1后界面上的基本数据的TextBox值会不断发生变化。 。当点击button2后(会有个“正在发送,请等待5s”的一个winform窗口弹出。当第二 次再次接收到数据后,会把协议转换成数据添加到ListBox中,但问题来了:为什么有时 点击button2后接收到的数据中ListBox的第一行数据有时是0没收到数据,有时候会读 到数??????????????????? 我这里button1的基本原理是给控制器发送一个协议,控制器收到后吧几个基本数据的 协议发送给winform窗口并将协议转换为基本数据记录到TextBox内,这时数据是无限 接收的,从而几个基本数据会不断地有变化。button2和button1原理类似都是发送一 个协议而给ListBox发送数据,发送完成后退出窗口,ListBox的所有行的值都变化之后 继续接收button1的基础数据。 接收代码: int S, A, B, C, D; private List<byte> memory = new List<byte>(4096); private byte[] bufferbyte = new byte[5]; private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e) { if (Closing) return; Control.CheckForIllegalCrossThreadCalls = false; int n = comm.BytesToRead; Byte[] bytes = new Byte[n]; r_count += n;//记录接收的字节 comm.Read(bytes, 0, n); try { this.Invoke((EventHandler)delegate { if (n > 0) { #region 协议解析/分析数据 //<协议解析> bool data_1_catched = false;//缓存记录数据是否捕获到 memory.AddRange(bytes);//缓存数据 while (memory.Count >= 2)//至少要包含头(1字节)+校验(1字节) { if (memory[0] == 0x88) { if (memory.Count < 5) break; //<数据校验> if ((memory[4] != (memory[1] + memory[2] + memory[3]) % 256) && (memory[4] != (memory[1] - 128 + memory[2] + memory[3]) % 256)) { memory.RemoveRange(0, 5); continue; } memory.CopyTo(0, bufferbyte, 0, 5); data_1_catched = true; memory.RemoveRange(0, 5); //<分析数据> if (data_1_catched) { #region 接收协议定义,用于将协议转化为数据 ............................. #endregion #region 将基本数据转化并填充到TextBox ............................. #endregion #region 将ListBox数据协议转化并填充到ListBox ............................. #endregion } } }); Button1方法比较简单,就是两句话: SendData("88", "FF", "01", "01", "01", 10);//是发送协议方法 周期为10ms comm.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived); Button2方法: private void ReadListBoxData_Click(object sender, EventArgs e) { WaitingForm waitf = new WaitingForm(); waitf.ShowIcon = false; waitf.label1.Text = "正在处理,请稍后......"; waitf.Show(); //如果不加上此句话,新窗体加载的内容都在队列中等待而不会绘制,从而导致新窗体没有内容。加上的话,新窗体会重新绘制 Application.DoEvents(); for (int ti = 0; ti < 4; ti++) { SendData("88", "FF", "04", "04", "07", 1000); } Thread.Sleep(4000); if (IsNull(bufferbyte) == true) { MessageBox.Show("重复超时,重新读取"); } waitf.Dispose(); //接受完ListBox的数据后,继续接收基本数据 SendData("88", "FF", "01", "01", "01", 10);// comm.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived); } 最大的问题再说一下,就是ListBox的第一行数据有的时候能收到数有时候收不到数,但是自己通过把数据转化到字符串框之后,发现第一列的协议都没有问题, 怀疑是和之前的基本数据协议的尾端发生冲突了,求解决办法?? 现在有一个方法是协商控制器,在发送第一组数据之前添加个5位保护协议。有没有 更好的方法???
C#输入三个人的姓名 科目 成绩,然后排名
如图这样、结果要显示在页面上 ![图片说明](https://img-ask.csdn.net/upload/201702/16/1487223256_32229.png) 通过TextBox1 button label 来完成 网页的
C#保存图片到sql server2012的image格式,再读取出来的时候总是说“参数错误”
C#读取图片文件,然后将其保存到Sql Server 2012里的一张表里,该列的数据类型为Image。 然后再读取数据库,先用内存流保存该二进制图片,然后将内存流转换成位图显示。 转换成位图的时候总是显示“参数错误”。 **选择图片** 时测试过,可以用picturebox正常显示: OpenFileDialog openDlg = new OpenFileDialog(); openDlg.Filter = "图片文件(*.jpg)|*.jpg"; string filePath = ""; if (openDlg.ShowDialog() == DialogResult.OK) { filePath = openDlg.FileName; this.label_newcharacter_picture_filepath.Text = filePath; /*-------打开文件流,用来读取图片文件中的数据------*/ FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); /*-------修改picturebox_newcharacter_picturedisplay对应的图片------*/ Bitmap bitmap1 = new Bitmap(stream); pictureBox_newcharacter_picturedisplay.Image = bitmap1; /*-------将文件流中的数据存储到内存字节组picturebuffer中------*/ picturebuffer = new byte[stream.Length]; stream.Read(picturebuffer, 0, (int)stream.Length); stream.Close(); } 此处picturebox可以正常显示图片,并且用picturebuffer存储了图片的内容。 **存储图片** SqlCommand cmd = new SqlCommand("StoredProcedure", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@chno", SqlDbType.Char).Value = textBox_newcharacter_chno.Text; cmd.Parameters.Add("@career", SqlDbType.Char).Value = textBox_newcharacter_career.Text; cmd.Parameters.Add("@skill", SqlDbType.VarChar).Value = textBox_newcharacter_skill.Text; cmd.Parameters.Add("@picture", SqlDbType.Image).Value = picturebuffer; cmd.ExecuteNonQuery(); MessageBox.Show("新建成功!"); 也能正常存储,并且打开数据库也能看到<二进制数据>字样。 再 **读取数据** con.Open(); string CharacterInfoSelect = "select * from character where chno = '" + CharacterNum + "'"; SqlDataAdapter CharacterAdapter = new SqlDataAdapter(CharacterInfoSelect, con); DataTable CharacterTabel = new DataTable(); CharacterAdapter.Fill(CharacterTabel); textBox_character_chno.Text = CharacterTabel.Rows[0][0].ToString(); textBox_character_career.Text = CharacterTabel.Rows[0][1].ToString(); textBox_character_skill.Text = CharacterTabel.Rows[0][2].ToString(); byte[] picturebuffer = (byte[])CharacterTabel.Rows[0][3]; MemoryStream stream1 = new MemoryStream(picturebuffer); stream1.Write(picturebuffer, 0, picturebuffer.Length); Image img = Image.FromStream(stream1); pictureBox_character_picturedisplay.Image = img; 设断点调试,总是在执行 Image img = Image.FromStream(stream1); 时跳到catch。 试过别的办法: string sql = "select picture from character where chno = '" + CharacterNum + "'"; SqlCommand cmm = new SqlCommand(sql, con); SqlDataReader reader = cmm.ExecuteReader(); reader.Read(); MemoryStream stream = new MemoryStream((byte[])reader[0]); pictureBox_character_picturedisplay.Image = Image.FromStream(stream); 没用。 byte[] picturebuffer = (byte[])CharacterTabel.Rows[0][3]; MemoryStream stream1 = new MemoryStream(picturebuffer); Bitmap bitmap1 = new Bitmap(picturebuffer); pictureBox_character_picturedisplay.Image = bitmap1; 这是书上最原始的代码,也行不通。 我在想是不是存入Sql server的时候,用Image格式存储会导致某种改变还是啥。别的数据都是对的,唯独读不出图片,求解。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
有哪些让程序员受益终生的建议
从业五年多,辗转两个大厂,出过书,创过业,从技术小白成长为基层管理,联合几个业内大牛回答下这个问题,希望能帮到大家,记得帮我点赞哦。 敲黑板!!!读了这篇文章,你将知道如何才能进大厂,如何实现财务自由,如何在工作中游刃有余,这篇文章很长,但绝对是精品,记得帮我点赞哦!!!! 一腔肺腑之言,能看进去多少,就看你自己了!!! 目录: 在校生篇: 为什么要尽量进大厂? 如何选择语言及方...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
Python 编程开发 实用经验和技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法和技巧,包括小数保留指定位小数、判断变量的数据类型、类方法@classmethod、制表符中文对齐、遍历字典、datetime.timedelta的使用等,会持续更新......
YouTube排名第一的励志英文演讲《Dream(梦想)》
Idon’t know what that dream is that you have, I don't care how disappointing it might have been as you've been working toward that dream,but that dream that you’re holding in your mind, that it’s po...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问