首页 > 其他 > 详细

Bool 类型变量的使用

时间:2014-10-23 15:58:51      阅读:334      评论:0      收藏:0      [点我收藏+]

定义一个bool类型的变量,默认为FALSE的

 1 private bool BHaveBeenTip=false;
 2 private void label5_Click(object sender, EventArgs e)
 3         {
 4             var oFileBrowser = new FileBowser();
 5             if (oFileBrowser.ShowDialog() == DialogResult.OK)
 6             {
 7                 foreach (string fName in oFileBrowser.ListSelectedFile)
 8                 {
 9                         this.AddAttachment(fName, false, false);
10                 }
11                 bHasBeenTips = false;
12             }
13             oFileBrowser.Dispose();
14         }
15 
16 private void AddAttachment(string aFileName, bool aIsDelete, bool aIsLargeAttachment)
17 {
18             if (attachList.Exists(o => o.Equals(aFileName, StringComparison.OrdinalIgnoreCase)))
19             {
20                      if (!bHasBeenTips)     //此处省略了  if(!bHasBeenTips==true)
21                     { 
22                 MessageBoxEx.ShowBox("不允许上传同名文件.", MessageBoxButtons.OK);
23                 bHasBeenTips = true;
24 }
25                 return;
26             }
27             else
28             {
29                     ..................................
30              }
31 }

 

Bool 类型变量的使用

原文:http://www.cnblogs.com/jingsheng99/p/4045834.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!