基本信息
源码名称:C# 电脑锁屏示例源码
源码大小:2.40M
文件格式:.zip
开发语言:C#
更新时间:2019-03-12
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在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 Microsoft.Win32;
using System.Runtime.InteropServices;
namespace 周大生专用
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form3 frm3;
public Form2 frm2;
private void timer1_Tick(object sender, EventArgs e)
{
toolStripStatusLabel3.Text = DateTime.Now.ToLongTimeString();
}
private void Form1_Load_1(object sender, EventArgs e)
{
timer1.Start();
textBox1.Hide();
try //可能有异常,放在try块中
{
RegistryKey rsg = null; //声明变量
rsg = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft", true); //true表可修改
if (rsg.GetValue("HoanReg") != null) //如果值不为空
{
this.textBox1.Text = rsg.GetValue("HoanReg").ToString(); //读取值
}
else
this.textBox1.Text = "user";
rsg.Close(); //关闭
}
catch (Exception ex) //捕获异常
{
this.textBox1.Text = ex.Message; //显示异常信息
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
if(frm2==null)
frm2 = new Form2();
frm2.f1 = this;
frm2.Show();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
if(frm3==null)
frm3 = new Form3();
frm3.f1 = this;
frm3.Show();
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
this.Close();
}
private void 退出FToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void 注销AToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
if (frm2 == null)
frm2 = new Form2();
frm2.f1 = this;
frm2.Show();
}
private void toolStripButton6_Click(object sender, EventArgs e)
{
this.Hide();
if (frm2 == null)
frm2 = new Form2();
frm2.f1 = this;
frm2.Show();
}
private void 修改密码XToolStripMenuItem_Click(object sender, EventArgs e)
{
if (frm3 == null)
frm3 = new Form3();
frm3.f1 = this;
frm3.Show();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
}
}