当前位置: 首页 > 编程日记 > 正文

WinForm容器内控件批量效验是否允许为空?设置是否只读?设置是否可用等方法分享...

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chinahuyong/article/details/47395633

WinForm容器内控件批量效验是否允许为空?设置是否只读?设置是否可用等方法分享

在WinForm程序中,我们有时需要对某容器内的所有控件做批量操作、如批量判断是否允许为空?批量设置为只读、批量设置为可用或不可用等常用操作,本文分享这几种方法,起抛砖引玉的作用,欢迎讨论!

1、  清除容器控件内里面指定控件的值的方法

/// <summary>
/// 清除容器里面指定控件的值(通过控件的AccessibleName属性设置为"EmptyValue")
/// </summary>
/// <param name="parContainer">容器控件</param>
public static void EmptyControlValue(Control parContainer)
{
    for (int index = 0; index < parContainer.Controls.Count; index++)
    {
        //如果是容器类控件,递归调用自己
        if (parContainer.Controls[index].HasChildren && !parContainer.Controls[index].GetType().Name.ToLower().StartsWith("uc"))
        {
            EmptyControlValue(parContainer.Controls[index]);
        }
        else
        {
            if (parContainer.Controls[index].AccessibleName == null ||
                !parContainer.Controls[index].AccessibleName.ToLower().Contains("emptyvalue"))
            {
                continue;
            }
            switch (parContainer.Controls[index].GetType().Name)
            {
                case "Label":
                    break;
                //case "ComboBox":
                //    ((ComboBox)(parContainer.Controls[index])).Text = "";                          
                //    break;
                case "TextBox":
                    ((TextBox)(parContainer.Controls[index])).Text = "";
                    break;
                case "UcTextBox":
                    ((UcTextBox)(parContainer.Controls[index])).Text = "";
                    break;
                case "RichTextBox":
                    ((RichTextBox)(parContainer.Controls[index])).Text = "";
                    break;
                case "MaskedTextBox":
                    ((MaskedTextBox)(parContainer.Controls[index])).Text = "";
                    break;
                case "UcMaskTextBox":
                    ((UcMaskTextBox)(parContainer.Controls[index])).Text = "";
                    break;
                case "RadioButton":
                    ((RadioButton)(parContainer.Controls[index])).Checked = false;
                    break;
                case "CheckBox":
                    ((CheckBox)(parContainer.Controls[index])).Checked = false;
                    break;
            }
        }
    }
}

要清空控件的值、只需调用:

EmptyControlValue(容器控件名称);

2、断一容器控件内某控件的值是否可以为空?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/// <summary>
/// 判断一容器控件内某控件的值是否可以为空(通过控件的AccessibleName属性设置为"NotNull")
/// <remarks>
///     说明:
///         此方法显示提示信息,对于相应取值不能为空的控件,应设置其“Tag”属性,以友好提示信息。
/// </remarks>
/// </summary>
/// <param name="parContainer">容器控件</param>
public static bool ControlValueIsEmpty(Control parContainer)
{
    bool returnValue = true;
    string hintInfo = string.Empty;
    for (int index = 0; index < parContainer.Controls.Count; index++)
    {
        //如果是容器类控件,递归调用自己
        if (parContainer.Controls[index].HasChildren && !parContainer.Controls[index].GetType().Name.ToLower().StartsWith("uc"))
        {
            ControlValueIsEmpty(parContainer.Controls[index]);
        }
        else
        {
            if (string.IsNullOrEmpty(parContainer.Controls[index].AccessibleName))
            {
                continue;
            }
            if (!parContainer.Controls[index].AccessibleName.ToLower().Contains("notnull")
                && !parContainer.Controls[index].GetType().Name.ToLower().Contains("mask"))
            {
                continue;
            }
            switch (parContainer.Controls[index].GetType().Name)
            {
                case "Label"://排除Label
                    break;
                case "ComboBox":
                case "ComboBoxEx":
                case "UcComboBoxEx":
                    if (parContainer.Controls[index] is ComboBox)
                    {
                        if (((ComboBox)(parContainer.Controls[index])).Text.Trim() == string.Empty)
                        {
                            hintInfo += GetControlName((ComboBox)parContainer.Controls[index]) + "\n";
                            //ShowInfo((ComboBox)parContainer.Controls[index], " 不能为空!");
                            //((ComboBox)(parContainer.Controls[index])).Focus();
                            returnValue = false;
                        }
                    }
                    else
                    {
                        if (((UcComboBoxEx)(parContainer.Controls[index])).Text.Trim() == string.Empty)
                        {
                            hintInfo += GetControlName((UcComboBoxEx)parContainer.Controls[index]) + "\n";
                            //ShowInfo((UcComboBoxEx)parContainer.Controls[index], " 不能为空!");
                            //((UcComboBoxEx)(parContainer.Controls[index])).Focus();
                            returnValue = false;
                        }
                    }
                    break;
                case "TextBox":
                case "UcTextBox":
                    if (parContainer.Controls[index] is TextBox)
                    {
                        if (((TextBox)(parContainer.Controls[index])).Text.Trim() == string.Empty)
                        {
                            hintInfo += GetControlName((TextBox)parContainer.Controls[index]) + "\n";
                            //ShowInfo((TextBox)parContainer.Controls[index], " 不能为空!");
                            //((TextBox)(parContainer.Controls[index])).Focus();
                            returnValue = false;
                        }
                    }
                    else
                    {
                        if (((UcTextBox)(parContainer.Controls[index])).Text.Trim() == string.Empty)
                        {
                            hintInfo += GetControlName((UcTextBox)parContainer.Controls[index]) + "\n";
                            //ShowInfo((UcTextBox)parContainer.Controls[index], " 不能为空!");
                            //((UcTextBox)(parContainer.Controls[index])).Focus();
                            returnValue = false;
                        }
                    }
                    break;
                case "RichTextBox":
                    if (((RichTextBox)(parContainer.Controls[index])).Text.Trim() == string.Empty)
                    {
                        hintInfo += GetControlName((RichTextBox)parContainer.Controls[index]) + "\n";
                        //ShowInfo((RichTextBox)parContainer.Controls[index], " 不能为空!");
                        //((RichTextBox)(parContainer.Controls[index])).Focus();
                        returnValue = false;
                    }
                    break;
                case "MaskedTextBox":
                case "UcMaskTextBox":
                    string mskTxtValue = string.Empty;
                    object controlChinaeseName = null;
                    if (parContainer.Controls[index] is MaskedTextBox)
                    {
                        mskTxtValue = ((MaskedTextBox)(parContainer.Controls[index])).Text;
                        controlChinaeseName = ((MaskedTextBox)(parContainer.Controls[index])).Tag ?? ((MaskedTextBox)(parContainer.Controls[index])).Name;
                    }
                    else
                    {
                        mskTxtValue = ((UcMaskTextBox)(parContainer.Controls[index])).Text;
                        controlChinaeseName = ((UcMaskTextBox)(parContainer.Controls[index])).Tag ?? ((UcMaskTextBox)(parContainer.Controls[index])).Name;
                    }
                    if (mskTxtValue.Substring(0, 4).Trim().Length > 0) //如果有有值,则要对输入的日期进行格式判断
                    {
                        if (DateTimeHelper.IsDate(mskTxtValue))
                        {
                            //把用户输入的日期数据控制在(1754-01-01 至 9999-12-31这间),这主要解决SqlServer与C#日期范围的冲突
                            if (DateTimeHelper.ToDate(mskTxtValue) < DateTimeHelper.ToDate("1754-01-01") ||
                                DateTimeHelper.ToDate(mskTxtValue) >= DateTimeHelper.ToDate("9999-12-31"))
                            {
                                MessageBoxHelper.ShowErrorMsg("[" + controlChinaeseName + "] 日期范围不正确! /n正确日期范围为:1754-01-01 至 9999-12-31");
                                returnValue = false;
                            }
                        }
                        else
                        {
                            MessageBoxHelper.ShowErrorMsg("[" + controlChinaeseName + "] 日期格式不正确! 正确格式如:2012-01-01");
                            returnValue = false;
                        }
                    }
                    else
                    {
                        if (mskTxtValue.Substring(0, 5).Equals("    -") && parContainer.Controls[index].AccessibleName.ToLower() == "notnull")
                        {
                            MessageBoxHelper.ShowErrorMsg("[" + controlChinaeseName + "]不能为空!");
                            returnValue = false;
                        }
                    }
                    break;
                default:
                    break;
            }
        }
    }
    if (!string.IsNullOrEmpty(hintInfo.Trim()))
    {
        MessageBoxHelper.ShowWarningMsg(hintInfo + "不能为空!");
    }
    return returnValue;
}
private static string GetControlName(Control ctr)
{
    if (ctr.Tag == null)
    {
        return ctr.Name;
    }
    else
    {
        return ctr.Tag.ToString();
    }
}
private static void ShowInfo(Control ctr, string info)
{
    if (ctr.Tag == null)
    {
        MessageBoxHelper.ShowWarningMsg(ctr.Name + info);
    }
    else
    {
        MessageBoxHelper.ShowWarningMsg(ctr.Tag + info);
    }
}

方法“ControlValueIsEmpty”可以用于批量判断指定容器内的所有控件是否可以为空,对于不为空的可以做批量提示显示,设置如下图所示:

3、设置容器控件中包含的控件为只读?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/// <summary>
/// 设置容器控件中包含的控件为只读(通过控件的AccessibleName属性设置为"CanReadOnly")
/// </summary>
/// <param name="parContainer">容器控件</param>
/// <param name="isReadOnly">是否为只读,true是只读,false则相反</param>>
public static void SetControlReadOnly(Control parContainer, bool isReadOnly)
{
    for (int index = 0; index < parContainer.Controls.Count; index++)
    {
        //如果是容器类控件,递归调用自己
        if (parContainer.Controls[index].HasChildren)
        {
            SetControlReadOnly(parContainer.Controls[index], isReadOnly);
        }
        else
        {
            if (parContainer.Controls[index].AccessibleName == null &&
              !parContainer.Controls[index].AccessibleName.ToLower().Contains("canreadonly"))
            {
                continue;
            }
            switch (parContainer.Controls[index].GetType().Name)
            {
                case "TextBox":
                case "UcTextBox":
                    if (parContainer.Controls[index] is TextBox)
                    {
                        ((TextBox)(parContainer.Controls[index])).ReadOnly = isReadOnly;
                    }
                    else
                    {
                        ((UcTextBox)(parContainer.Controls[index])).ReadOnly = isReadOnly;
                    }
                    break;
                case "RichTextBox":
                    ((RichTextBox)(parContainer.Controls[index])).ReadOnly = isReadOnly;
                    break;
                case "MaskedTextBox":
                case "UcMaskTextBox":
                    if (parContainer.Controls[index] is MaskedTextBox)
                    {
                        ((MaskedTextBox)(parContainer.Controls[index])).ReadOnly = isReadOnly;
                    }
                    else
                    {
                        ((UcMaskTextBox)(parContainer.Controls[index])).ReadOnly = isReadOnly;
                    }
                    break;
                case "ComboBox":
                    ((ComboBox)(parContainer.Controls[index])).Enabled = !isReadOnly;
                    break;
                case "Button":
                case "UcButton":
                    if (parContainer.Controls[index] is Button)
                    {
                        ((Button)(parContainer.Controls[index])).Enabled = !isReadOnly;
                    }
                    else
                    {
                        ((UcButton)(parContainer.Controls[index])).Enabled = !isReadOnly;
                    }
                    break;
                default:
                    break;
            }
        }
    }
}

方法“SetControlReadOnly”的使用方式与上面的方法相同,只要设置控件的“AccessibleName”属性为“CanReadOnly”即可。

4、设置容器控件中包含的控件是否可用?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/// <summary>
/// 设置容器控件中包含的控件是否可用(通过控件的AccessibleName属性设置为"Enabled")
/// </summary>
/// <param name="parContainer">容器控件</param>
/// <param name="isEnabled">是否为用可,true:可用,false:不可用</param>>
public static void SetControlEnabled(Control parContainer, bool isEnabled)
{
    for (int index = 0; index < parContainer.Controls.Count; index++)
    {
        //如果是容器类控件,递归调用自己
        if (parContainer.Controls[index].HasChildren)
        {
            SetControlEnabled(parContainer.Controls[index], isEnabled);
        }
        else
        {
            if (parContainer.Controls[index].AccessibleName == null &&
               !parContainer.Controls[index].AccessibleName.ToLower().Contains("Enabled"))
            {
                continue;
            }
            //(parContainer.Controls[index]).BackColor = System.Drawing.Color.White;//设置当前控件的背景色为白色
            switch (parContainer.Controls[index].GetType().Name)
            {
                case "Label":
                    break;
                default:
                    parContainer.Controls[index].Enabled = isEnabled;
                    break;
            }
        }
    }
}

方法“SetControlEnabled”用于设置容器控件内的指定控件的Enabled属性。

同时需要说明的时,这些方法可以同时设置,只需要设置控件的“AccessibleName”为这种类型即可:EmptyValue| NotNull |Enabled|CanReadOnly,这样设置即可,对于提示信息的显示,我们可以设置控件的Tag属性。

欢迎关注RDIFramework.NET框架官方公众微信(微信号:guosisoft),及时了解最新动态。

扫描二维码立即关注

作者: EricHu 
出处:http://www.cnblogs.com/huyong/ 
Email:406590790@qq.com 
QQ交流:406590790 
框架官网:http://www.rdiframework.net/ 
框架官网博客:http://blog.rdiframework.net/ 
框架其他博客:http://blog.csdn.net/chinahuyong 
               http://www.cnblogs.com/huyong
RDIFramework.NET,基于.NET的快速信息化系统开发、整合框架,给用户和开发者最佳的.Net框架部署方案。 
关于作者:高级工程师、信息系统项目管理师、DBA。专注于微软平台项目架构、管理和企业解决方案,多年项目开发与管理经验,曾多次组织并开发多个大型项目,在面向对象、面向服务以及数据库领域有一定的造诣。现主要从事基于 RDIFramework.NET框架的技术开发、咨询工作,主要服务于金融、医疗卫生、铁路、电信、物流、物联网、制造、零售等行业。 
如有问题或建议,请多多赐教! 
本文版权归作者和CNBLOGS博客共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题,可以通过邮箱或QQ 联系我,非常感谢。

相关文章:

“不会Linux,怎么当程序员?”骨灰级程序员:干啥都不行。

说起优秀程序员的必备技能&#xff0c;我想大家都可以说很多&#xff0c;比如&#xff1a;数据结构、算法、数学、编程语言等等。但是&#xff0c;你可能会忽略了每一个程序员都应该掌握的技能&#xff1a;Linux。想一想&#xff0c;我们日常学习、求职、工作场景的中&#xff…

与空连接相关的几条命令

1)建立空连接:net use \\IP\ipc$ "" /user:"" (一定要注意:这一行命令中包含了3个空格) 2)建立非空连接:net use \\IP\ipc$ "密码" /user:"用户名" (同样有3个空格)3)映射默认共享:net use z: \\IP\c$ "密码" /u…

Windows客户端C/C++编程规范“建议”——宏

6 宏 6.1 减少宏的使用 等级&#xff1a; 【建议】说明&#xff1a;宏的使用&#xff0c;将使得调试变得麻烦。所以在设计和使用宏的时候&#xff0c;请确保宏的逻辑是阅读者不会去关心细节的行为。6.2 宏定义中字母需大写 等级&#xff1a; 【必须】说明&#xff1a;为了醒目…

Struts2中通配符的使用

1、准备工作 新建一个JavaWeb项目HelloWord&#xff0c;导入Struts2的.jar包&#xff0c;在Web.xml下配置Struts2的监听&#xff0c;在src下添加Struts2的配置文件struts.xml&#xff1b;将该项目部署到服务器(Tomcat)上&#xff0c;运行检查项目是否部署成功和其他错误&#x…

关于Spark NLP学习,你需要掌握的LightPipeline(附代码)| CSDN博文精选

作者 | Veysel Kocaman, Data Scientist & ML Researcher ANKIT CHOUDHARY翻译 | 赵春光校对 | 申利彬来源 | 数据派THU(*点击阅读原文&#xff0c;查看作者更多精彩文章&#xff09;【导读】Pipeline具体来说是一个多阶段的序列&#xff0c;每个阶段由一个Transformer或者…

网络编程--ftp客户端的实现(c#版)

.net2.0对ftp有了一个很好的封装,但是确容易让人忽略ftp的真正内部实现,下面是我实现的ftp客户端的功能,其主要步骤是这样的:1、创建一个FtpWebRequest对象&#xff0c;指向ftp服务器的uri 2、设置ftp的执行方法&#xff08;上传&#xff0c;下载等&#xff09; 3、给FtpWebReq…

Windows客户端C/C++编程规范“建议”——文件

7 文件 7.1 正确使用#include 等级&#xff1a;【推荐】 说明&#xff1a;#include <>和#include “”导致编译器在搜索文件时&#xff0c;搜索的路径顺序不同。所以需要正确使用#include&#xff0c;以避免包含错了头文件。 语法形式操作带引号的形式预处理器按以下…

让你的网站支持 Emoji

SegmentFault有用户提出要支持Emoji表情输入&#xff0c;就研究了一下&#xff1a; 要记得备份数据库。 首先Mysql数据库在5.5.3之后开始支持utf8mb4字符集&#xff0c;所以mysql版本是5.5.3&#xff0b;的都可以设置让数据库存储Emoji表情&#xff0c;如果你的应用有移动端的&…

Windows客户端C/C++编程规范“建议”——变量和常量

8 变量和常量 8.1 尽量不要使用全局变量 等级&#xff1a; 【要求】说明&#xff1a;全局变量的滥用和goto的滥用一样&#xff0c;都是一种灾难。它将使得逻辑变得难以调试和控制。8.2 不涉及外部使用的全局变量需要使用static关键字修饰 等级&#xff1a; 【要求】说明&#…

机器学习模型五花八门不知道怎么选?这份指南告诉你

作者 | LAVANYA译者 | 陆离编辑 | 夕颜出品 | AI科技大本营&#xff08;ID: rgznai100&#xff09;【导读】在本文中&#xff0c;我们将探讨不同的机器学习模型&#xff0c;以及每个模型合理的使用场景。一般来说&#xff0c;基于树形结构的模型在Kaggle竞赛中是表现最好的&…

WinAPI: FlattenPath、WidenPath

不管什么曲线命令, 到来路径中都会变成 Bezier 线; 也就是说路径中只有直线和 Bezier 线.FlattenPath 和 WidenPath 都能够把路径中的 Bezier 线转换为近似的直线; 不同的是: 用 WidenPath 转换后貌似加宽了线, 其实它是转换成了一个包围路径的新路径(类似区域).本例效果图:代码…

Android - 小的特点 - 使用最新版本ShareSDK手册分享(分享自己定义的接口)

前太实用Share SDK很快分享&#xff0c;但官员demo快捷共享接口已被设置死&#xff0c;该公司的产品还设计了自己的份额接口&#xff0c;这需要我手动共享。 读了一堆公文&#xff0c;最终写出来&#xff0c;行&#xff0c;废话&#xff0c;进入主题。 之前没实用过ShareSDK分享…

结合Flink,国内自研,大规模实时动态认知图谱平台——AbutionGraph |博文精选

作者 | Raini出品 | 北京图特摩斯科技 &#xff08;www.thutmose.cn&#xff09;(*点击阅读原文&#xff0c;查看作者更多精彩文章&#xff09;Flink&#xff1a;目前最受关注的大数据技术&#xff0c;最活跃 Apache 项目之一。AbutionGraph&#xff1a;北京图特摩斯科技自研的…

Windows客户端C/C++编程规范“建议”——风格

9 风格 9.1 优先使用匈牙利命名法 等级&#xff1a; 【推荐】说明&#xff1a;该方法由微软总设计师设计。Windows上编程最好遵从该标准。详细介绍见&#xff1a;http://zh.wikipedia.org/wiki/%E5%8C%88%E7%89%99%E5%88%A9%E5%91%BD%E5%90%8D%E6%B3%959.2 变量名结合使用匈牙…

使用GIF(仅限Delphi2007)

-----------uses GIFImg; procedure TForm1.FormCreate(Sender: TObject); begin // 先在窗体上放一个 TImage 组件&#xff1a;Image1&#xff1b; Image1.Picture.LoadFromFile(C:\Example.gif); // AnimationSpeed 设定动画速度&#xff0c;值越大&#xff0c;速度越快…

使用Depth Texture

使用Depth Textures&#xff1a;   可以将depth信息渲染到一张texture&#xff0c;有些效果的制作会需要scene depth信息&#xff0c;此时depth texture就可以派上用场了。   Depth Texture在不同平台上有不同的实现&#xff0c;并且原生的支持也不一样。   UnityCG.cgin…

Exchage 2007 Client Application Functions(2) -- 如何收取邮件

上一篇介绍的Exchange2007客户端程序中怎么发送邮件。现在&#xff0c;我来简单介绍一下怎么收取邮件。来看代码&#xff1a;publicHashtable GetAllMails(DateTime StartDate, DateTime EndDate) { try { if (null this.m_esb) …

VC开发Windows客户端软件之旅——前言

从第一次拖着行李入京找活&#xff0c;至今已工作若干年了。这些年一直追逐自己的梦想&#xff0c;跑过三个城市&#xff0c;换了三份工作&#xff0c;认识了很多业内的朋友。和朋友们闲聊时&#xff0c;发现很多人都已经不再做客户端软件了。有的转去做管理&#xff0c;有的转…

代替Mask R-CNN,BlendMask欲做实例预测任务的新基准?

「免费学习 60 节公开课&#xff1a;投票页面&#xff0c;点击讲师头像」作者 | Hao Chen、Kunyang Sun、Zhi Tian、Chunhua Shen、Yongming Huang、Youliang Yan译者 | 刘畅编辑 | Jane出品 | AI科技大本营&#xff08;ID&#xff1a;rgznai100&#xff09;【导读】实例分割是…

如何让ie 7 支持box-shadow

box-shadow是一个很好用并且也常用的css 3属性&#xff0c;但是&#xff0c;如果我们要保证它能在ie 8及更低的版本下运行的话&#xff0c;需要借助一些其他的插件或文件。在这里我主要讲一下&#xff0c;如何用PIE.htc来解决ie 7不支持box-shadow。 代码如下&#xff1a; <…

拥有AI「变声术」,秒杀了多年苦练的模仿艺能

「免费学习 60 节公开课&#xff1a;投票页面&#xff0c;点击讲师头像」作者 | Daniel Chen&#xff0c;爱奇艺资深研发工程师 出品 | AI科技大本营&#xff08;ID&#xff1a;rgznai100&#xff09;【导读】什么是Voice Conversion&#xff08;VC&#xff09;&#xff1f;它有…

服务器架设笔记——编译Apache及其插件

之前一直从事Windows上的客户端软件开发&#xff0c;经常会处理和服务器交互相关的业务。由于希望成为一个全栈式的工程师&#xff0c;我对Linux上服务器相关的开发也越来越感兴趣。趁着年底自由的时间比较多&#xff0c;我可以对这块做些技术研究。虽然这些知识很基础也很老&a…

Silverlight 2中多语言支持实现(上)

引言 最近项目要在Silverlight 2应用程序中实现本地化&#xff0c;原以为这个过程非常简单&#xff0c;却没想到实现的时候一波三折&#xff0c;好在结果还算不错。需求是这样的&#xff0c;用户第一次访问的时候&#xff0c;默认为英文&#xff0c;当用户选择一种显示语言后&a…

解析大型.NET ERP系统 多国语言实现

实现多国语言有许多种实现方案&#xff0c;无外乎是一种字符串替换技术&#xff0c;将界面控件的文本标签替换成相应语言的文字。.NET Windows Forms实现多国语言的方法有以下几种&#xff1a; 1 .NET的方案&#xff0c;使用资源文件 分别做三个语言的资源文件&#xff0c;比如…

服务器架设笔记——Apache模块开发基础知识

通过上节的例子&#xff0c;我们发现Apache插件开发的一个门槛便是学习它自成体系的一套API。虽然Apache的官网上有对这些API的详细介绍&#xff0c;但是空拿着一些零散的说明书&#xff0c;是很难快速建立起一套可以运行的系统。&#xff08;转载请指明出于breaksoftware的csd…

解密Elasticsearch技术,腾讯开源的万亿级分布式搜索分析引擎

「免费学习 60 节公开课&#xff1a;投票页面&#xff0c;点击讲师头像」作者 | johngqjiang&#xff0c;腾讯 TEG 云架构平台部研发工程师来源 | 腾讯技术工程&#xff08;ID&#xff1a;Tencent_TEG&#xff09;【导读】Elasticsearch&#xff08;ES&#xff09;作为开源首选…

Centos5上firefox的升级

Centos5上firefox的升级默认Centos5上firefox的版本是1.5当我们使用yum update firefox提示到的版本还是1.5 可是我们在使用1.5版本的firefox可能会有一些问题&#xff0c;比如打不开QQ空间接下来我们就将系统的firefox从rpm包的1.5版本升级到tar包的3.0首先删除1.5版本的fire…

cheat engine lua

function CEButton1Click(sender) local x getProperty(CETrainer.CEEdit1,"Text")--这句很重要,获取文本框的值 --writeInteger(0x42c0c0,readInteger(0x42c0c0)x)--设置0X42C0C0地址的值 setProperty(CETrainer.CEEdit2,"Text","0001000")--设…

服务器架设笔记——使用Apache插件解析简单请求

一般来说&#xff0c;对于一个请求&#xff0c;服务器都会对其进行解析&#xff0c;以确定请求的合法性以及行进的路径。于是本节将讲解如何获取请求的数据。&#xff08;转载请指明出于breaksoftware的csdn博客&#xff09; 我们使用《服务器架设笔记——编译Apache及其插件》…

如何用Python快速抓取Google搜索?

「免费学习 60 节公开课&#xff1a;投票页面&#xff0c;点击讲师头像」作者 | linksc译者 | 弯月&#xff0c;编辑 | 郭芮来源 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09;自从2011年 Google Web Search API 被弃用以来&#xff0c;我一直在寻找其他的方法来抓取G…