惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - FLAHunter的咖啡屋

李开复第四封信:大学四年应是这样度过 (摘抄) 程序设计的时候,也别忘了界面美化 - FLAHunter的咖啡屋 - 博客园 学习.net 必读的书(摘抄) 终于把企业销售管理系统搞定了....学到的确不少 本地宽带网出了问题..好几天都上不了博客网,郁闷啊 关于我的internet连接共享闯出的大祸!!! 开始编企业销售管理信息系统..界面要进一步强化!! 看了光良童话的MV....感动ing...... 上午终于把图书管理系统搞定了!!好累!! 界面设计与测试规则(摘抄) 今天开始编图书管理系统,适应一下C# 最耐玩的探密游戏(据说全世界只有4000人逃离了这个房间!!!) 丛林法则 终于把windows窗体的登录验证搞定了! 我的博客地图终于嵌入了!只要加段脚本就行 我的博客地图 关于数据挖掘的研究 关于C#的数据绑定 终于开始Blog啦!
关于windows窗体登录验证的思考
FLAHunter的咖啡屋 · 2005-07-11 · via 博客园 - FLAHunter的咖啡屋
   

    下午本来想适应一下登录验证的设计,结果错误接踵而来.纠正了大半天,还是没有搞定.本以为很快就可以搞定的...结果一直拖到晚上.

    先是在判断用户名或密码为空时进行了处理,原以为

    if (!textBox1.Text)   或者

    if (textBox1.Text==null) 就可以搞定.结果编译老是报错.......想了半天,于是改为

    if (textBox1.Text="")  这样终于可以搞定了

    于是我想,难道.net开发平台不支持前面两种情况吗?怀疑ing.................

    接着就是报了一个非常头痛的错误.系统老是报出这样的一种错误

  

   真是让我很头疼.也看不懂上面究竟写的是什么.
 但我大体明白问题应该出现在以下几行代码:
 
 this.sqlConnection1.ConnectionString = "workstation id=\"DELL-FLA\";packet size=4096;integrated security=SSPI;data source=\"" +
    "dell-fla\";persist security info=False;initial catalog=Book";

 这是连接数据库.

 string loginstr = "SELECT UserPsw FROM User" + "WHERE (UserName = '"+ this.textBox1.Text +"')";
   SqlCommand mycom = new SqlCommand(loginstr,this.sqlConnection1);
   try
   {

    this.sqlConnection1.Open();

    SqlDataReader loginreader;
    loginreader = mycom.ExecuteReader();
    if (loginreader.Read())
    {
     this.Visible=false;
     Form1 form = new Form1();
     form.ShowDialog();
     this.Visible=true;
    }
    else
    {
     MessageBox.Show("请输入正确用户名和密码!!");
     return;
    }
   }
   catch(Exception ee)
   {
    MessageBox.Show(ee.ToString());
   }   
   this.sqlConnection1.Close();

 这是按扭事件处理,真搞不懂到底出错在哪
 不管了,还是早点睡吧,明天再想了