当前位置: 首页>>代码示例>>C#>>正文


C# Object.GetValue方法代码示例

本文整理汇总了C#中Object.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Object.GetValue方法的具体用法?C# Object.GetValue怎么用?C# Object.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Object的用法示例。


在下文中一共展示了Object.GetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: runTest


//.........这里部分代码省略.........
       Console.WriteLine( s_strTFAbbrev+ "Err_234uq");
       } catch (ArgumentException) {}
       catch (Exception exc) {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_383da! , exc=="+exc);
       }
       strLoc = "Loc_485ef";
       in4Arr = new Int32[2];
       iCountTestcases++;
       try {
       in4Arr.SetValue( (Object) 4, -1);
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_52ssa");
       } catch (IndexOutOfRangeException) {}
       catch (Exception exc) {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_5278q, " + exc.ToString());
       }
       iCountTestcases++;
       try {
       in4Arr.SetValue( (Object) (Object)4, 2);
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_52vua");
       } catch (IndexOutOfRangeException) {}
       catch ( Exception exc ) {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_234ay, " + exc.ToString());
       }
       strLoc = "Loc_373uy";
       in4Arr = new Int32[2];
       in4Arr.SetValue((Object)((short)2), 0 );
       in4Arr.SetValue((Object)(int) -20, 1);
       iCountTestcases++;
       if((Int32) in4Arr.GetValue(0) != 2 || in4Arr[1] != -20)
	 {
	 iCountErrors++;
	 Console.WriteLine( s_strTFAbbrev+ "Err_2349w");
	 }
       strLoc = "Loc_486ef";
       in8Arr = new Int64[2];
       iCountTestcases++;
       try {
       in8Arr.SetValue((Object)4, -1);
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_5234a");
       } catch (IndexOutOfRangeException) {}
       catch (Exception exc) {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_5228q, " + exc.ToString());
       }
       iCountTestcases++;
       try {
       in8Arr.SetValue((Object)4, 2);
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_524ua");
       } catch (IndexOutOfRangeException) {}
       catch ( Exception exc ) {
       iCountErrors++;
       Console.WriteLine( s_strTFAbbrev+ "Err_233ay, " + exc.ToString());
       }
       strLoc = "Loc_373fg";
       in8Arr = new Int64[3];
       in8Arr.SetValue((Object)((short)2), 0);
       in8Arr.SetValue((Object)((int)-20), 1);
       in8Arr.SetValue((Object)((long)200), 2);
       iCountTestcases++;
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:67,代码来源:co3750setvalue_vi.cs


注:本文中的Object.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。