本文整理汇总了C#中SerializationInfo.GetUInt64方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetUInt64方法的具体用法?C# SerializationInfo.GetUInt64怎么用?C# SerializationInfo.GetUInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationInfo
的用法示例。
在下文中一共展示了SerializationInfo.GetUInt64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
//.........这里部分代码省略.........
Console.WriteLine("UInt16 ticks, " + Environment.TickCount);
for(int i=0; i<50; i++) {
strLoc="Loc_6473cd_" + i;
ui16Value = (ushort)((int)UInt16.MaxValue * rnd1.NextDouble());
strValue = "UInt16_" + i;
serinfo1.AddValue(strValue, ui16Value);
iCountTestcases++;
if(serinfo1.GetUInt16(strValue)!= ui16Value)
{
iCountErrors++;
Console.WriteLine("Err_748vd_" + i + "! Wrong value returned, " + serinfo1.GetUInt16(strValue));
}
}
Console.WriteLine("UInt32 ticks, " + Environment.TickCount);
for(int i=0; i<50; i++) {
strLoc="Loc_7573cd_" + i;
ui32Value = (uint)(UInt32.MaxValue * rnd1.NextDouble());
strValue = "UInt32_" + i;
serinfo1.AddValue(strValue, ui32Value);
iCountTestcases++;
if(serinfo1.GetUInt32(strValue)!= ui32Value)
{
iCountErrors++;
Console.WriteLine("Err_4738cd_" + i + "! Wrong value returned, " + serinfo1.GetUInt32(strValue));
}
}
Console.WriteLine("UInt64 ticks, " + Environment.TickCount);
for(int i=0; i<50; i++) {
strLoc="Loc_63dc_" + i;
ui64Value = (ulong)(UInt64.MaxValue * rnd1.NextDouble());
strValue = "UInt64_" + i;
serinfo1.AddValue(strValue, ui64Value);
iCountTestcases++;
if(serinfo1.GetUInt64(strValue)!= ui64Value)
{
iCountErrors++;
Console.WriteLine("Err_6583fd_" + i + "! Wrong value returned, " + serinfo1.GetUInt64(strValue));
}
}
Console.WriteLine("Double ticks, " + Environment.TickCount);
for(int i=0; i<50; i++) {
strLoc="Loc_7539cd_" + i;
dblValue = Double.MaxValue * rnd1.NextDouble();
if(rnd1.NextDouble()<0.5)
dblValue = (-1 * dblValue);
strValue = "Double_" + i;
serinfo1.AddValue(strValue, dblValue);
iCountTestcases++;
if(serinfo1.GetDouble(strValue)!= dblValue)
{
iCountErrors++;
Console.WriteLine("Err_653cfd_" + i + "! Wrong value returned, " + serinfo1.GetDouble(strValue));
}
}
Console.WriteLine("Single ticks, " + Environment.TickCount);
for(int i=0; i<50; i++) {
strLoc="Loc_0247fd_" + i;
sglValue = (float)(Single.MaxValue * rnd1.NextDouble());
if(rnd1.NextDouble()<0.5)
sglValue = (-1 * sglValue);
strValue = "Single_" + i;
serinfo1.AddValue(strValue, sglValue);
iCountTestcases++;
if(serinfo1.GetSingle(strValue)!= sglValue)
{
iCountErrors++;