您好,欢迎来到微智科技网。
搜索
您的当前位置:首页C#模拟登录界面

C#模拟登录界面

来源:微智科技网
源代码:

using System;

using System.Collections.Generic; using System.Linq; using System.Text;

using System.Threading.Tasks;

namespace APP9 {

class Program {

static void Main(string[] args) { qw:

Console.Write(\"请输入用户名:\"); string Name = Console.ReadLine(); Console.Write(\"请输入用户密码:\"); string Pwd = Console.ReadLine();

if(Name==\"huangyanling\" & Pwd==\"123456\") {

Console.WriteLine(\"登录成功\"); } else {

Console.WriteLine(\"登录失败\"); }

if (Name != \"huangyanling\" || Pwd != \"123456\") {

goto qw; }

Console.ReadLine(); } } }

运行结果:

源代码:

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;

1

using System.Windows.Forms;

namespace WindowsFormsApplication1 {

public partial class Form1 : Form {

public Form1() {

InitializeComponent(); }

private void Form1_Load(object sender, EventArgs e) {

}

private void button1_Click(object sender, EventArgs e) {

if(textBox1.Text==\"hyl\" && textBox2.Text==\"000000\") {

button1.Text=\"登录成功\"; }

else {

button1.Text=\"登录失败\"; }

}

private void label1_Click(object sender, EventArgs e) {

}

private void button2_Click(object sender, EventArgs e) {

Random rad = new Random();

int value = rad.Next(1000,9999); label6.Text = value.ToString(); } } }

运行结果图:

2

3

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 7swz.com 版权所有 赣ICP备2024042798号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务