关于c#的小程序

关于c#的小程序,第1张

using System;

using SystemCollectionsGeneric;

using SystemComponentModel;

using SystemData;

using SystemDrawing;

using SystemText;

using SystemWindowsForms;

namespace WindowsApplication1

{

public partial class FormQ : Form

{

public FormQ()

{

InitializeComponent();

}

private void textBox1_KeyDown(object sender, KeyEventArgs e)

{

if (eKeyValueToString()Equals("13"))

{

switch (thislabel1Text)

{

case "question 1 ":

thislabel1Text = "question 2 ";

if (thistextBox1TextToUpper()Equals("B"))

thistextBox2Text = ConvertToString(ConvertToInt32(thistextBox2Text) + 1);

else

thistextBox3Text = ConvertToString(ConvertToInt32(thistextBox3Text) + 1);

break;

case "question 2 ":

thislabel1Text = "question 3 ";

if (thistextBox1TextToUpper()Equals("D"))

thistextBox2Text = ConvertToString(ConvertToInt32(thistextBox2Text) + 1);

else

thistextBox3Text = ConvertToString(ConvertToInt32(thistextBox3Text) + 1);

break;

case "question 3 ":

thislabel1Text = "question 1 ";

if (thistextBox1TextToUpper()Equals("A"))

thistextBox2Text = ConvertToString(ConvertToInt32(thistextBox2Text) + 1);

else

thistextBox3Text = ConvertToString(ConvertToInt32(thistextBox3Text) + 1);

break;

default:

thislabel1Text = "question 1 ";

break;

}

thistextBox1Text = stringEmpty;

}

}

/// <summary>

/// 必需的设计器变量。

/// </summary>

private SystemComponentModelIContainer components = null;

/// <summary>

/// 清理所有正在使用的资源。

/// </summary>

/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>

protected override void Dispose(bool disposing)

{

if (disposing && (components != null))

{

componentsDispose();

}

baseDispose(disposing);

}

#region Windows 窗体设计器生成的代码

/// <summary>

/// 设计器支持所需的方法 - 不要

/// 使用代码编辑器修改此方法的内容。

/// </summary>

private void InitializeComponent()

{

thislabel1 = new SystemWindowsFormsLabel();

thistextBox1 = new SystemWindowsFormsTextBox();

thistextBox2 = new SystemWindowsFormsTextBox();

thistextBox3 = new SystemWindowsFormsTextBox();

thislabel2 = new SystemWindowsFormsLabel();

thislabel3 = new SystemWindowsFormsLabel();

thislabel4 = new SystemWindowsFormsLabel();

thislabel5 = new SystemWindowsFormsLabel();

thisSuspendLayout();

//

// label1

//

thislabel1AutoSize = true;

thislabel1Location = new SystemDrawingPoint(30, 29);

thislabel1Name = "label1";

thislabel1Size = new SystemDrawingSize(77, 12);

thislabel1TabIndex = 0;

thislabel1Text = "question 1 ";

//

// textBox1

//

thistextBox1Location = new SystemDrawingPoint(73, 69);

thistextBox1Name = "textBox1";

thistextBox1Size = new SystemDrawingSize(151, 21);

thistextBox1TabIndex = 1;

thistextBox1KeyDown += new SystemWindowsFormsKeyEventHandler(thistextBox1_KeyDown);

//

// textBox2

//

thistextBox2Location = new SystemDrawingPoint(73, 115);

thistextBox2Name = "textBox2";

thistextBox2Size = new SystemDrawingSize(151, 21);

thistextBox2TabIndex = 2;

thistextBox2Text = "0";

//

// textBox3

//

thistextBox3Location = new SystemDrawingPoint(73, 161);

thistextBox3Name = "textBox3";

thistextBox3Size = new SystemDrawingSize(151, 21);

thistextBox3TabIndex = 3;

thistextBox3Text = "0";

//

// label2

//

thislabel2AutoSize = true;

thislabel2Location = new SystemDrawingPoint(26, 72);

thislabel2Name = "label2";

thislabel2Size = new SystemDrawingSize(29, 12);

thislabel2TabIndex = 4;

thislabel2Text = "答案";

//

// label3

//

thislabel3AutoSize = true;

thislabel3Location = new SystemDrawingPoint(30, 118);

thislabel3Name = "label3";

thislabel3Size = new SystemDrawingSize(29, 12);

thislabel3TabIndex = 5;

thislabel3Text = "正确";

//

// label4

//

thislabel4AutoSize = true;

thislabel4Location = new SystemDrawingPoint(30, 164);

thislabel4Name = "label4";

thislabel4Size = new SystemDrawingSize(29, 12);

thislabel4TabIndex = 6;

thislabel4Text = "错误";

//

// label5

//

thislabel5AutoSize = true;

thislabel5Location = new SystemDrawingPoint(231, 72);

thislabel5Name = "label5";

thislabel5Size = new SystemDrawingSize(77, 12);

thislabel5TabIndex = 7;

thislabel5Text = "回车提交答案";

//

// FormQ

//

thisAutoScaleDimensions = new SystemDrawingSizeF(6F, 12F);

thisAutoScaleMode = SystemWindowsFormsAutoScaleModeFont;

thisClientSize = new SystemDrawingSize(324, 230);

thisControlsAdd(thislabel5);

thisControlsAdd(thislabel4);

thisControlsAdd(thislabel3);

thisControlsAdd(thislabel2);

thisControlsAdd(thistextBox3);

thisControlsAdd(thistextBox2);

thisControlsAdd(thistextBox1);

thisControlsAdd(thislabel1);

thisName = "FormQ";

thisText = "FormQ";

thisResumeLayout(false);

thisPerformLayout();

}

#endregion

private SystemWindowsFormsLabel label1;

private SystemWindowsFormsTextBox textBox1;

private SystemWindowsFormsTextBox textBox2;

private SystemWindowsFormsTextBox textBox3;

private SystemWindowsFormsLabel label2;

private SystemWindowsFormsLabel label3;

private SystemWindowsFormsLabel label4;

private SystemWindowsFormsLabel label5;

}

}

public class Test {

public static void main(String args[]) {

int result=0;//运算结果

int count=0;//第几个 *** 作数 从0开始

for(int a=12;a<=1002;a+=10){

if(count%2!=0)//判断奇偶

result-=a;

else

result+=a;

count++;

}

Systemoutprintln(result);

}

}

把select U_sername改为select count()

然后检查你的accdb中的connExcc是不是调用的ExecuteScalar,如果不是,看看accdb 中是不是有一个调用ExecuteScalar的方法,把你的connExcc改过来。

以上就是关于关于c#的小程序全部的内容,包括:关于c#的小程序、编写Java小程序,求12-22+32-42+...+972-982+992-1002的值。、c#winform小程序,用ACCESS作数据库。一个注册窗口,检验输入的用户名是否已经存在,我写的方法如下:等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/10165343.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-05
下一篇2023-05-05

发表评论

登录后才能评论

评论列表(0条)

    保存