private void btProcessDefine_Click(object sender, Eventarg什么意思s e) { Window targ什么意思etWindow = (Window)draw

34高校学生宿舍信息管理系统-第5页
上亿文档资料,等你来发现
34高校学生宿舍信息管理系统-5
else{;}};privatevoidbtnEnter_Clic;boolisValidUser=st;//验证用户是否为合法用户isValidUser;if(isValidUser){;stringsql=String.Format(;values;txtLoginPwd.Text,;('{0}','{1}','{2}'
private void btnEnter_Click(object sender, EventArgs e)
bool isValidUser =
string message = \
if (IsValidataInput())
//验证用户是否为合法用户
isValidUser IsValidataUser(txtLoginNo.Text.Trim(), cboLoginType.Text, ref message);
if (isValidUser)
string sql = String.Format(\into DB_ManageInfo(loginNo,loginPwd,loginType) values = txtLoginPwd.Text, ('{0}','{1}','{2}')\oginType.Text);
int result = DBHelper.GetDsqlResult(sql);
if (result == 1)
MessageBox.Show(\注册成功!\注册提示\
MessageBox.Show(\注册失败!\注册提示\
MessageBox.Show(message,\注册提示\
txtLoginNo.Clear();
txtLoginPwd.Clear();
DtxtLoginPwd.Clear();
cboLoginType.SelectedIndex = -1;
txtLoginNo.Focus();
private void btnExit_Click(object sender, EventArgs e)
this.Close();
private void btnCanel_Click(object sender, EventArgs e)
this.Close();
} } (3)主界面: 功能:数据的显示,操作,各窗口跳转。 代码如下:
22 using S using System.Collections.G ponentM using System.D using System.D using System.L using System.T using System.Windows.F namespace VirgoMis {
public partial class WFMain : Form
public WFMain()
InitializeComponent();
private T OpenUniqueMDIChildWindow(Form mdiParent) where T : Form, new()
foreach (Form subForm in mdiParent.MdiChildren)
if (!subForm.GetType().Equals(typeof(T)))
subForm.Close();
subForm.Activate();
return subForm as T;
T newForm = new T();
newForm.MdiParent = mdiP
//newForm.FormBorderStyle = FormBorderStyle.N
//newForm.WindowState = FormWindowState.M
//newForm.MaximizeBox =
//newForm.MinimizeBox =
newForm.StartPosition FormStartPosition.CenterS
newForm.Show();
return newF
private void WFManage_Load(object sender, EventArgs e)
tsslState.Text = String.Format(\:{1} 登陆中\
private EventArgs e)
DialogResult result = MessageBox.Show(\您确定要退出该系统吗?\操作提示void etsmiAppExit_Click(object sender, = \
if (result == DialogResult.OK)
Application.Exit();
private void ztsmiDormRegister_Click(object sender, EventArgs e)
OpenUniqueMDIChildWindow(this);
/*foreach (Form form in this.MdiChildren)
if (!form.GetType().Equals(typeof(DormRegister)))
form.Close();
form.Activate();
DormRegister WFdr = new DormRegister();
WFdr.MdiParent =
WFdr.Location = new Point(0,0);
WFdr.Show();*/
private void btsmiBuildInfo_Click(object sender, EventArgs e)
OpenUniqueMDIChildWindow(this);
private void dtsmiDormInfo_Click(object sender,
25 三亿文库包含各类专业文献、外语学习资料、各类资格考试、中学教育、文学作品欣赏、高等教育、应用写作文书、34高校学生宿舍信息管理系统等内容。 
 学生管理 报修管理 违规管理 系统设置信息 管理宿舍信息 管理学生住宿信 管理宿舍维修信 管理违规学生信 (四)系统功能结构 根据高校学生宿舍信息管理系统的特点,可将...  学生公寓管理 是高校基础性的管理工作,学生公寓管理系统对一个重点高校来说是必不可少的 组成部分,随着我校规模的不断扩大,在校人数不断的增加,必将引起大家对学...  城建学院本科毕业设计(论文) 摘要 摘要 当今时代是飞速发展的信息时代,管理信息系统在现代社会已深入到各行各业, 然而, 现 今有许多高校仍然用手工对宿舍进行管理...  《信息系统分析与设计》期末考试 2010 级信管专业 1A 班
学年第一学期 系统分析与系统设计报告 系统名称:高校学生公寓信息管理系统 序号: 学号: 姓名...  1 毕业设计(论文)报告 题目: 姓名: 顾翔 高校宿舍管理系统的设计 学号: ...本网站是针对天津职业大学而设计的, 其实现了学生信息添加与查询,宿舍信息添加与...  全面地掌握学生住宿情况等目的;为宿舍管理部门, 开发设计专用系统--高校学生宿舍信息管理系统来进行管理学生宿舍信息,使学生宿舍信息实 现标准化的管理和规范化的制度...  宿舍订水管理.报修管理等,使宿舍的管理效率更高。 意义 系统动能及需求分析 学生信息管理。该功能模块主要包括:查询学生信息;添加学生信息;修改学生信息; 宿舍分配;...  宿舍信息管理系统 摘要随着电脑的普及和使用,计算机技术也在不断发展。管理信息系 统在现代社会已深入到各行各业了。高校学生宿舍是大学生生活、学习、休息的重要...sender,最全面的sender文章 - 电子工程世界网
在电子工程世界为您找到如下关于“sender”的新闻
sender资料下载
Gmail sender...
Smtp mail sender with attachments....
unit Video interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, stdctrls, ExtCtrls, avicap, mmsystem, dsgnintf // Types for event-procedurestype TCapStatusProc = procedure(Sender...
在WinCE操作系统中,用于读取电池的状态。
调用方法:
//主窗口电池
Battery battery = new Battery();
Battery.State SLast = Battery.State.N
//主界面时钟,用户查看电池状态
private void timer2_Tick(object sender, EventArgs...
process list and Handel Message sender test...
sender的verilog利用fpga实现...
sms sender 察到布局图全貌,需要靠移动上下、左右滚动条来寻找。利用缩小功能,将布局图缩小整个放在屏幕上,而后再找需要观察的位置,找到后,将鼠标移至此处,单击鼠标左键,则布局图按原比例放大,所选处处于屏幕中心...
工业测控时,通常需要由下位机向PC机发送数据以使PC机了解系统的测试数据或下位机的运行状态,并进而控制下位机的行为。利用Spcomm串口控件接收下位机发送的数据信息的示例代码如下://事件驱动方式接收数据程序mlReceiveData(Sender:Tobject Buffer:Pointer bufferLength:Word...
technology. This protocol allows multi-recipient using the same public key, use it the sender can transmit the cryptograph to multi-recipient at once time by broadcast. During the process of encrypting...
从QT的demo中的broadcast sender和broadcast receiver 自己修改的,通过QUdpSocket网络广播传输一组QPoint坐标的QList容器。...
sender相关帖子
;& && &&&Functor); 这五个重载的返回值都是 QMetaObject::Connection,现在我们不去关心这个返回值。下面我们先来看看 connect() 函数最常用的一般形式:[C] 纯文本查看 复制代码1.& & // !!! Qt 5
2.& & connect(sender...
; &&&private void Form1_Load(object sender, EventArgs e)
& && && && &pictureBox1.Image =
& &nbsp...
clear functionUDP Sender / ReceiverV1.0UDP客户端UDP server 示例代码
第一步:连接FireBeetle Board-ESP32,为upload程序做好准备
如果该程序是你新建或者从例题中调阅,则在编辑完毕后,需要在tools菜单中,选择下载并运行,如果已经在你的设备里了,你可以直接选择run
information in this email, including any attachments, may only be used by the intended recipient. If you received this email in error, please contact the sender and delete or destroy the material...
, please contact the sender and delete or destroy the material immediately. Thank you.&
(已解决)SensorTile license申请出问题 有否试试换个邮箱地址? 你能看到自己发出的邮件吗? 我的申请也一样,可能是邮箱的问题 我新装了一下BlueMS,重新申请了一下,可以收到ST回复的...
; && && &Loaded += OnL
& && &&&private async void OnLoaded(object sender, RoutedEventArgs...
("[GENERAL EVENT] - ID=[%d] Sender=[%d]\n\n",
&&&&&&&&&&&&&& pDevEvent-&EventData.deviceEvent.status,
&&&&nbsp...
sender (DeviceID = [color=#0000ff][b]TxAdr[/b][/color] = TxLog --- TxLogicAddress的意思)
receiver(DeviceID = [b][color=#0000ff][backcolor=yellow]RxAdr[/backcolor][/color][/b] = RxLog...
如需要更多单片机编程经验集资料,可以taobao搜【c开发板 以太网】购买配套板子,看到店主是ruandingyuan的那个即可
阮工的单片机编程经验集V2.0:如何做稳定单片机程序:
1.中断和 main函数或其子函数 里不要同时有同一外设模块信号的操作,如对74hc595的操作,对HT1621B的操作的信号线必须是有序的,而不能穿插,否则容易错乱或花屏
2.中断里...
][color=#999999]dontium 发表于
16:00[/color][/url][/size]
很不好意思,这个芯片的LNA和PA是在一块引出,没办法加二极管限幅。
楼主看看可调整的,象Rbias等关系到 ...[/quote]
我看了一些资料,初步判断原因为:CC1101在交互通信距离很短时(1m以内),sender发射功率很大,15 dBm以上...
sender视频
你可能感兴趣的标签
热门资源推荐下次自动登录
现在的位置:
& 综合 & 正文
.Net软件UI界面测试自动化–Windows API
在目前进行软件测试时,都或多或少的引入了自动化测试的概念,而且市面上也有好多软件自动化方面相关的工具,比如QTP,比如LoadRunner,但是这些工具要么售价不菲,要么对某些方面功能支持的不够全面,那么我们在引入软件自动化测试时,都需要考虑哪些方面呢?当然是最符合自己项目的工具最合适,同时费用也比较低,那么除了市面上这些商业软件外,还有没有哪些方法可以自己动手来做软件的自动化测试呢?答案是肯定的.
本文将介绍实现软件自动化测试其中一种测试方法------Windows API技术,当然,此种方法仅限于对.Net软件使用,还有一些比较通用的方法,将在后续的文章中进行介绍(使用UIAutomation类).
反射技术具体是什么原理,本文将不做任何介绍,大家可以去网上搜索一下,有很多这方面的文章介绍,本文只介绍如何使用Windows API技术进行.NET软件的UI界面的自动化测试.
废话少说,多做实事!(本文所有代码均在VS2008环境下测试通过)
一. 创建待测试程序
1. 启动VS2008,建立一个C#的WinForm工程,并将工程文件名命名为AUT(Application Under Test)
2. 创建的Form上的按钮布局,如下图所示
3. 一个菜单(包含一个以及菜单File以及一个二级菜单Exit),一个TextBox,一个ComboBox,一个Button以及一个ListBox
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuI
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuI
private System.Windows.Forms.TextBox textBox1;
private System.boBox comboBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ListBox listBox1;
4. 给Button按钮添加一个消息响应函数
private void button1_Click(object sender, EventArgs e)
string tb = textBox1.T
string cb = comboBox1.T
if (tb == cb)
listBox1.Items.Add("Result is a tie");
else if (tb == "paper" && cb == "rock" ||
tb == "rock" && cb == "scissors" ||
tb == "scissors" && cb == "paper")
listBox1.Items.Add("The TextBox wins");
listBox1.Items.Add("The ComboBox wins");
5. 给Exit菜单添加一个消息响应函数
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
Application.Exit();
6.给ComboBox控件添加三个Item,分别为paper,rock,scissions
7. 编译待测试程序,生成文件名为AUT.exe的待测试程序
二. 创建测试程序
1. 启动VS2008,创建一个C#控制台程序,并命名为WindowsUITest
2. 在工程中添加以下using语句
using System.D
using System.Runtime.InteropS
using System.T
using System.IO;
using System.T
3. 声明需要使用到的WIndows API
[DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Auto)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowsName);
[DllImport("user32.dll", EntryPoint = "FindWindowEx", CharSet = CharSet.Auto)]
static extern IntPtr FindWindowEx(IntPtr hwndParent,
IntPtr hwndChildAfter,
string lpszClass,
string lpszWindow);
//用于发送WM_CHAR消息
[DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Auto)]
static extern void SendMessage1(IntPtr hWnd, uint Msg, int wParam, int lParam);
//用于发送WM_COMMAND消息
[DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Auto)]
static extern void SendMessage2(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam);
//用于发送WM_GETTEXT消息
[DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Auto)]
static extern int SendMessage3(IntPtr hWndControl, uint Msg, int wParam, byte[] lParam);
//用于发送LB_FINDSTRING消息
[DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Auto)]
static extern int SendMessage4(IntPtr hWnd, uint Msg, int wParam, byte[] lParam);
//用于发送WM_LBUTTONDOWN和WM_LBUTTONUP消息
[DllImport("user32.dll", EntryPoint="PostMessage", CharSet=CharSet.Auto)]
static extern bool PostMessage1(IntPtr hWnd, uint Msg, int wParam, int lParam);
//菜单函数相关
[DllImport("user32.dll")]
static extern IntPtr GetMenu(IntPtr hWnd);
[DllImport("user32.dll")]
static extern IntPtr GetSubMenu(IntPtr hMenu, int nPos);
[DllImport("user32.dll")]
static extern int GetMenuItemID(IntPtr hMenu, int nPos);
4. 定义查询窗体的函数
static IntPtr FindTopLevelWindow(string caption, int delay, int maxTries)
IntPtr mwh = IntPtr.Z
bool formFount =
int attempts = 0;
mwh = FindWindow(null, caption);
if (mwh == IntPtr.Zero)
Console.WriteLine("Form not yet found");
Thread.Sleep(delay);
Console.WriteLine("Form has been found");
formFount =
while (!formFount && attempts & maxTries);
if (mwh != IntPtr.Zero)
throw new Exception("Could not found Main Window");
static IntPtr FindMainWindowHandle(string caption, int delay, int maxTries)
return FindTopLevelWindow(caption, delay, maxTries);
static IntPtr FindMessageBox(string caption)
int delay = 100;
int maxTries = 25;
return FindTopLevelWindow(caption, delay, maxTries);
static IntPtr FindWindowByIndex(IntPtr hwndParent, int index)
if (index == 0)
return hwndP
int ct = 0;
IntPtr result = IntPtr.Z
result = FindWindowEx(hwndParent, result, null, null);
if (result != IntPtr.Zero)
while (ct & index && result != IntPtr.Zero);
定义发送字符串/字符的函数
static void SendChar(IntPtr hControl, char c)
uint WM_CHAR = 0x0102;
SendMessage1(hControl, WM_CHAR, c, 0);
static void SendChars(IntPtr hControl, string s)
foreach (char c in s)
SendChar(hControl, c);
6. 定义点击鼠标按钮的函数
static void ClickOn(IntPtr hControl)
uint WM_LBUTTONDOWN = 0x0201;
uint WM_LBUTTONUP = 0x0202;
PostMessage1(hControl, WM_LBUTTONDOWN, 0, 0);
PostMessage1(hControl, WM_LBUTTONUP, 0, 0);
7. 编写测试代码
[STAThread]
static void Main(string[] args)
Console.WriteLine("\nLaunching application under test");
string path = Directory.GetCurrentDirectory() + "\\AUT.exe";
Process p = Process.Start(path);
Thread.Sleep(2000);
Console.WriteLine("\nFinding main window handle");
IntPtr mwh = FindMainWindowHandle("Form1", 100, 25);
Console.WriteLine("Main window handle = " + mwh);
Thread.Sleep(2000);
//因为测试程序是使用C#创建的,所以控件的Class名称会比较奇怪,可以使用SPY++工具来查看
IntPtr tb = FindWindowEx(mwh, IntPtr.Zero, "WindowsForms10.EDIT.app.0.378734a", "");
IntPtr cb = FindWindowEx(mwh, IntPtr.Zero, "BOBOX.app.0.378734a", "");
IntPtr bt = FindWindowEx(mwh, IntPtr.Zero, null, "button1");
IntPtr lb = FindWindowEx(mwh, IntPtr.Zero, "WindowsForms10.LISTBOX.app.0.378734a", "");
if (tb == IntPtr.Zero || cb == IntPtr.Zero ||
bt == IntPtr.Zero || lb == IntPtr.Zero)
throw new Exception("Unable to find all controls");
Console.WriteLine("All control handles found");
//设置数据
SendChars(tb, "paper");
SendChars(cb, "rock");
ClickOn(bt);
Thread.Sleep(1000);
uint LB_FINDSTRING = 0x018F;
byte[] bResult = Encoding.ASCII.GetBytes("The TextBox wins");
int result = SendMessage4(lb, LB_FINDSTRING, -1, bResult);
//uint WM_GETTEXT = 0x000D;
if (result &= 0)
Console.WriteLine("\nTest scenario result = Pass");
Console.WriteLine("\nTest scenario result = Fail");
Console.WriteLine("\nExiting app in 3 seconds...");
Thread.Sleep(3000);
IntPtr hMainMenu = GetMenu(mwh);
//IntPtr hMainMenu = FindWindowEx(mwh, IntPtr.Zero, "WindowsForms10.Window.8.app.0.378734a", null);
IntPtr hFile = GetSubMenu(hMainMenu, 0);
int iexit = GetMenuItemID(hFile, 0);
uint WM_COMMAND = 0x0111;
SendMessage2(mwh, WM_COMMAND, iexit, IntPtr.Zero);
Console.WriteLine("\nDone");
Console.ReadLine();
catch (System.Exception ex)
编译测试程序,OK,大功告成
&&&&推荐文章:
【上篇】【下篇】private void button1_Click(object sender, System.EventArgs e)
start=Int32.Parse(this.textBox2.Text);
end=Int32.Parse(this.te
private void button1_Click(object sender, System.EventArgs e)
start=Int32.Parse(this.textBox2.Text);
end=Int32.Parse(this.textBox3.Text);
ip=IPAddress.Parse(textBox1.Text);
for(curr=curr<curr++)
ThreadPool.QueueUserWorkItem(new WaitCallback(scan));
private void scan(object me)
string p="端口";
tcp=new TcpClient();
ipe=new IPEndPoint(ip,curr);
tcp.Connect(ipe);
stream=tcp.GetStream();
if(stream.CanRead)
{p+=curr.ToString();
Monitor.Enter(this);
this.richTextBox1.AppendText(p+"开放"+"\n");
Monitor.Exit(this);
tcp.Close();
catch(Exception err)
}
总是只扫描一个端口就退出了,大家给指点下呀!
不把curr做成各相关信息公用的变量,调用的时候把它带到QueueUserWorkItem的第二个参数里,传给scan函数的形参me,然后在scan函数里用
int curr = (int)
就好了。
其实start和end两个变量也是只在button1_Click里定义就可以了。tcp、ipe、stream也是,大概在scan函数里定义就行了。
还有就是,是想start到end,包括end那个端口都扫描吗?如果是的话,for里的结束条件就要写成“<=”了。
IPAddress ip =
private void button1_Click(object sender, System.EventArgs e)
int start=Int32.Parse(this.textBox2.Text);
int end=Int32.Parse(this.textBox3.Text);
ip=IPAddress.Parse(textBox1.Text);
for(int curr=curr<=curr++)
{ ThreadPool.QueueUserWorkItem(new WaitCallback(scan), curr);
private void scan(object me)
int curr = (int)
string p="端口";
TcpClient tcp=new TcpClient();
IPEndPoint ipe=new IPEndPoint(ip,curr);
tcp.Connect(ipe);
NetworkStream stream=tcp.GetStream();
if(stream.CanRead)
{p+=curr.ToString();
Monitor.Enter(this);
this.richTextBox1.AppendText(p+"开放"+"\n");
Monitor.Exit(this);
tcp.Close();
catch(Exception err)
不把curr做成各相关信息公用的变量,调用的时候把它带到QueueUserWorkItem的第二个参数里,传给scan函数的形参me,然后在scan函数里用
int curr = (int)
就好了。
其实start和end两个变量也是只在button1_Click里定义就可以了。tcp、ipe、stream也是,大概在scan函数里定义就行了。
还有就是,是想start到end,包括end那个端口都扫描吗?如果是的话,for里的结束条件就要写成“<=”了。
IPAddress ip =
private void button1_Click(object sender, System.EventArgs e)
int start=Int32.Parse(this.textBox2.Text);
int end=Int32.Parse(this.textBox3.Text);
ip=IPAddress.Parse(textBox1.Text);
for(int curr=curr<=curr++)
{ ThreadPool.QueueUserWorkItem(new WaitCallback(scan), curr);
private void scan(object me)
int curr = (int)
string p="端口";
TcpClient tcp=new TcpClient();
IPEndPoint ipe=new IPEndPoint(ip,curr);
tcp.Connect(ipe);
NetworkStream stream=tcp.GetStream();
if(stream.CanRead)
{p+=curr.ToString();
Monitor.Enter(this);
this.richTextBox1.AppendText(p+"开放"+"\n");
Monitor.Exit(this);
tcp.Close();
catch(Exception err)
1,显示控件工具栏
2.单击控件工具栏上命令按钮
3.在工作表上单击 生成命令按钮
4.双击生成的命令按钮,进入代码输入
[e20]=[e20]+1
退出代码窗...
这个很简单的,找点编程方面的书看看,定义两个变量,就行了,把选择项的那块也看看,这个程序我编好了,需要的话跟我联系
这句代码的意思是:以下是针对控件command1的Click()事件所编写的过程代码
NetBeans IDE 6.1试试
instr 你用这个函数进行查找八!!!
一般人都是左脑开发得好一些,那应该如何进行小孩右脑开发呢?
答: cisco网络技术是一个为CTO、IT技术经理、网络工程师、安全工程师、数据库工程师、网络管理员、系统工程师、开发工程师、项目管理人员等IT技术人员搭建的有关先...
答: 我想学网页制作、网络维护、电脑维护
可有比较好的学习网站或者论坛推选一下?
大家还关注
确定举报此问题
举报原因(必选):
广告或垃圾信息
激进时政或意识形态话题
不雅词句或人身攻击
侵犯他人隐私
其它违法和不良信息
报告,这不是个问题
报告原因(必选):
这不是个问题
这个问题分类似乎错了
这个不是我熟悉的地区
相关问答:123456789101112131415请具体解释一下(object sender, System.EventArgs e)的含义
请具体解释一下(object sender, System.EventArgs e)的含义
09-03-13 &
protected void Page_Load(object sender, EventArgs e)定义一个事件,protected 访问范围限定于所属的类或从该类派生的子类;object sender 定义事件的对象就是触发该事件的对象本身(sender);System.EventArgs e 包含事件数据数据的基类。
请登录后再发表评论!
具体的说来,对于系统提供的类的事件,Sender参数只是简单地传递了指向引发事件的那个类的实例的一个引用,而e是EventArgs类型的参数,它包含了事件所携带的信息。至于第二个问题,我不是很明白“我看到在很多事件代码中那些代码都是照写(object sender, System.EventArgs e),根本就不用改变sender和e,参数不是应该随实际情况变化的吗?”这句话的意思,比如说一个按钮控件,当它的单击事件被引发时,系统会自动把这个按钮对象作一个类型强制转换然后赋值给Sender,然后传递e。之所以都是这个形式是因为大多数情况下这些简单的事件不需要传递特殊的信息,您可以看一下KeyPress事件,这个事件就包含一个KeyPressEventArgs,包含了按键的信息。另外需要明确的一个概念就是类似这样形式的方法:private void Button_Click(object sender, EventArgs e)这样的方法称为事件处理方法,它类似于C语言中的事件处理函数,它是在运行时由系统调用的,因此它的参数不会变化,就好像我们写方法时的方法名一
请登录后再发表评论!

我要回帖

更多关于 targ什么意思 的文章

 

随机推荐