初始化CRICS
This commit is contained in:
59
ConsoleApplication666/Program.cs
Normal file
59
ConsoleApplication666/Program.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Numerics;
|
||||
using System.Collections;
|
||||
|
||||
namespace ConsoleApplication666
|
||||
{
|
||||
class Program
|
||||
{
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern void GetSystemTimePreciseAsFileTime(out long fileTime);
|
||||
|
||||
// 将 FILETIME (long) 转换为 DateTime
|
||||
public static DateTime GetNowPrecise()
|
||||
{
|
||||
long fileTime;
|
||||
GetSystemTimePreciseAsFileTime(out fileTime);
|
||||
DateTime localTime = DateTime.FromFileTimeUtc(fileTime).ToLocalTime();
|
||||
return localTime;
|
||||
|
||||
}
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
|
||||
BigInteger hugeNumber = BigInteger.Parse("1234567890123456789012345678901234567890");
|
||||
var H= hugeNumber.ToByteArray();
|
||||
|
||||
BitArray bi = new BitArray(H);
|
||||
|
||||
|
||||
// 从字节数组创建
|
||||
byte[] bytes = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
BigInteger fromBytes = new BigInteger(bytes);
|
||||
|
||||
// 基本运算
|
||||
BigInteger sum = hugeNumber + 1;
|
||||
BigInteger product = hugeNumber * 2;
|
||||
|
||||
Console.WriteLine("大数字: {0}", hugeNumber);
|
||||
Console.WriteLine("加1: {0}", sum);
|
||||
Console.WriteLine("乘2: {0}", product);
|
||||
|
||||
// 比较操作
|
||||
if (hugeNumber > BigInteger.Parse("100000000000000000000"))
|
||||
{
|
||||
Console.WriteLine("这是一个非常大的数字");
|
||||
}
|
||||
|
||||
DateTime ddd = GetNowPrecise();
|
||||
string tii = ddd.ToString("yyyy-MM-dd HH:mm:ss.ffffff");
|
||||
Console.WriteLine(tii);
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user