相关疑难解决方法(0)

为什么默认情况下只有文本字符串保存在实习池中?

为什么默认情况下只有文字字符串保存在实习池中?

来自MSDN的示例:

String s1 = "MyTest";
String s2 = new StringBuilder().Append("My").Append("Test").ToString(); 
String s3 = String.Intern(s2); 
Console.WriteLine("s1 == '{0}'", s1);
Console.WriteLine("s2 == '{0}'", s2);
Console.WriteLine("s3 == '{0}'", s3);
Console.WriteLine("Is s2 the same reference as s1?: {0}", (Object)s2==(Object)s1); 
Console.WriteLine("Is s3 the same reference as s1?: {0}", (Object)s3==(Object)s1);

/*
This example produces the following results:
s1 == 'MyTest'
s2 == 'MyTest'
s3 == 'MyTest'
Is s2 the same reference as s1?: False
Is s3 the same reference as s1?: True
*/
Run Code Online (Sandbox Code Playgroud)

.net c# compiler-construction string clr

29
推荐指数
2
解决办法
5422
查看次数

检查数组中每个TextBox的标签

如何检查数组中所有TextBox控件的Tag属性?
我想要这样的东西:

If textBox.Tag And textbox2.Tag And textbox21.Tag And
   textbox22.Tag And textbox23.Tag And textbox24.Tag = "2" Then
Run Code Online (Sandbox Code Playgroud)

这是我的TextBoxes数组:

Dim allTextboxes() As TextBox = {textBox, narNaslov, narPersona, narDani, narPersona2,
                                 kupIme, kupAdresa, kupKontakt, uvBroj, uvDatum, uvIznos,
                                 uvAvans, uvRok, uvNacin, datumTbox} 
Run Code Online (Sandbox Code Playgroud)

vb.net winforms

3
推荐指数
2
解决办法
82
查看次数

标签 统计

.net ×1

c# ×1

clr ×1

compiler-construction ×1

string ×1

vb.net ×1

winforms ×1