本文整理汇总了C#中String.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# String.GetValue方法的具体用法?C# String.GetValue怎么用?C# String.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String.GetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
public Boolean runTest()
{
Console.Error.WriteLine( s_strTFPath +" "+ s_strTFName +" ,for "+ s_strClassMethod +" ,Source ver "+ s_strDtTmVer );
String strLoc="Loc_000oo";
StringBuilder sblMsg = new StringBuilder( 99 );
int iCountErrors = 0;
int iCountTestcases = 0;
int[] in4Array1Target = null;
int in4Index = -1;
Object var3;
String str3 = null;
String[] str2Arr = null;
Int16[] in2Arr;
Int32[] in4Arr;
Int64[] in8Arr;
Single[] sglArr;
Double[] dblArr;
Byte[] bytArr;
SByte[] sbytArr;
Decimal[] currArr;
Decimal[] decArr;
try
{
do
{
strLoc="Loc_110dt";
in4Array1Target = new int[ (int)Byte.MaxValue + 22 ];
for ( int ia = 0 ;ia < in4Array1Target.Length ;ia++ )
{
in4Array1Target[ia] = ia;
}
in4Index = (int)Byte.MaxValue + 6;
var3 = in4Array1Target.GetValue( in4Index );
++iCountTestcases;
if ( !var3.Equals(in4Index) )
{
++iCountErrors;
Console.WriteLine( s_strTFAbbrev +"Err_342ji! var3=="+ var3 );
}
strLoc="Loc_325kf";
str2Arr = new String[5];
str2Arr.SetValue( "zero", 0 );
str3 = (String)str2Arr.GetValue( 0 );
++iCountTestcases;
if ( str3.Equals( str2Arr[0] ) != true )
{
++iCountErrors;
Console.WriteLine( s_strTFAbbrev +"Err_084nw! str2Arr[0]=="+ str2Arr[0] +" , str3=="+ str3 );
}
strLoc = "Loc_374wq";
bytArr = new Byte[2];
bytArr[0] = (Byte)23;
bytArr[1] = (Byte)5;
iCountTestcases++;
if(!bytArr.GetValue(0).Equals((Byte)23) || !bytArr.GetValue(1).Equals((Byte)5))
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_23093! , bytArr[0]=="+bytArr.GetValue(0)+" bytArr[1]=="+bytArr.GetValue(1));
}
strLoc = "Loc_4281i";
sbytArr = new SByte[2];
sbytArr[0] = (SByte)(-5);
sbytArr[1] = (SByte)4;
iCountTestcases++;
if(!sbytArr.GetValue(0).Equals((SByte)(-5)) || !sbytArr.GetValue(1).Equals((SByte)4))
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_299eu! , bytArr[0]=="+bytArr.GetValue(0)+", bytArr[1]=="+bytArr.GetValue(1));
}
strLoc = "Loc_388uq";
in2Arr = new Int16[2];
in2Arr[0] = (short)3;
in2Arr[1] = (short)20;
iCountTestcases++;
if(!in2Arr.GetValue(0).Equals((short)3) || !in2Arr.GetValue(1).Equals((short)20))
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_9823u");
}
strLoc = "Loc_982ew";
in4Arr = new Int32[2];
in4Arr[0] = 5;
in4Arr[1] = 200;
iCountTestcases++;
if(!in4Arr.GetValue(0).Equals(5) || !in4Arr.GetValue(1).Equals(200))
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_398yw");
}
strLoc = "Loc_123uq";
in8Arr = new Int64[2];
in8Arr[0] = 32;
in8Arr[1] = 878;
iCountTestcases++;
if(!in8Arr.GetValue(0).Equals((long)32) || !in8Arr.GetValue(1).Equals((long)878))
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_488ru! , inArr[0]=="+in8Arr.GetValue(0)+" inArr[1]=="+in8Arr.GetValue(1));
}
strLoc = "Loc_0982i";
//.........这里部分代码省略.........