关于锁定计算机的 就是网吧那种,不是用windows自带的lock,自己写的程序在弹出登陆界面那个时候,是锁定计算机的,怎么用c#代码实现,或者给我想法也好,不用直接贴代码,我现在已经有个登陆界面了,我觉得应该是在form初始化完后进行的操作,有人指教否?在线等,给个算法也好,我自己实现去。。说穿了就是网吧那个功能。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 [System.Runtime.InteropServices.DllImport("user32.dll")] static extern bool SetForegroundWindow(IntPtr hWnd); private void Form1_Load(object sender, EventArgs e) { this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.ShowInTaskbar = false; this.TopMost = true; this.timer1.Interval = 1; this.timer1.Enabled = true; this.WindowState = FormWindowState.Maximized; } private void timer1_Tick(object sender, EventArgs e) { SetForegroundWindow(this.Handle); } 设置login在所有窗体最前面SetForegroundWindowprivate void button1_Click(object sender, EventArgs e){ IntPtr hWnd1 = FindWindow(null, "主窗口标题"); SetForegroundWindow(hWnd1);} namespace WindowsApplication1{ public partial class Log : Form { private string connectionString = "Data Source = 192.168.1.102; Integrated Security = SSPI;database = netManager"; private SqlConnection myConnection; //适配器 private SqlDataAdapter da; //数据集 private DataSet ds = new DataSet(); //数据表 private DataTable LogTable; //数据行 private DataRow LogRow; private string StrSQL = "select * from UserTable"; public Log() { InitializeComponent(); this.myConnection = new SqlConnection(connectionString); this.da = new SqlDataAdapter(this.StrSQL, this.myConnection); this.ds.Clear(); this.da.Fill(ds, "UserTable"); this.LogTable = ds.Tables[0]; } private void logButton_Click(object sender, EventArgs e) { for (int i = 0; i < LogTable.Rows.Count; i++) { } } }}怎么加?我加不正确 搞定了。。thks.new了一个form出来作为背景嘿嘿 电子书(exe 格式的)如何转成flash格式的文件 小白问题:关于 File.Create() C++里面的CRC代码转为C#应该是?? 下面有C++CRC校验源码 (急需) 自定义类的二维数组如何使用 数据库更新问题的疑惑 用csc编译 exe 和 dll 文件时如何给文件加上版本号? 一个带参数的主从DropDownList 的问题(在线等待) 怎么样在结构体中,定义二维数组并且可以定义字长 有没有象outlook左边那个东西一样的控件? 关于Java和C#的比较??? 怎么用函数实现两个字符串交换 CSLY001 这种唯一自增编号是怎么自动生成的吗
static extern bool SetForegroundWindow(IntPtr hWnd); private void Form1_Load(object sender, EventArgs e)
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.ShowInTaskbar = false;
this.TopMost = true;
this.timer1.Interval = 1;
this.timer1.Enabled = true;
this.WindowState = FormWindowState.Maximized;
} private void timer1_Tick(object sender, EventArgs e)
{
SetForegroundWindow(this.Handle);
}
SetForegroundWindow
private void button1_Click(object sender, EventArgs e)
{
IntPtr hWnd1 = FindWindow(null, "主窗口标题");
SetForegroundWindow(hWnd1);
}
namespace WindowsApplication1
{
public partial class Log : Form
{
private string connectionString = "Data Source = 192.168.1.102; Integrated Security = SSPI;database = netManager";
private SqlConnection myConnection;
//适配器
private SqlDataAdapter da; //数据集
private DataSet ds = new DataSet();
//数据表
private DataTable LogTable;
//数据行
private DataRow LogRow;
private string StrSQL = "select * from UserTable";
public Log()
{
InitializeComponent();
this.myConnection = new SqlConnection(connectionString);
this.da = new SqlDataAdapter(this.StrSQL, this.myConnection);
this.ds.Clear();
this.da.Fill(ds, "UserTable");
this.LogTable = ds.Tables[0];
} private void logButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < LogTable.Rows.Count; i++)
{
}
}
}
}
怎么加?我加不正确
new了一个form出来作为背景嘿嘿