本文整理汇总了C#中System.UInt64.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# UInt64.ToString方法的具体用法?C# UInt64.ToString怎么用?C# UInt64.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.UInt64
的用法示例。
在下文中一共展示了UInt64.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleARP
/// <summary>
/// Handle ARP packets
/// </summary>
/// <param name="packet">The EthernetDatagram</param>
/// <param name="arp">The ArpDatagram to parse</param>
public static void HandleARP(Packet packet, ArpDatagram arp,
ref UInt64 frame_id, object[] ctrl)
{
ListViewItem item = new ListViewItem(frame_id.ToString());
frame_id++;
List<string> packet_info = new List<string>();
ListView frames = (ListView)ctrl[0];
EthernetDatagram ethernet = packet.Ethernet;
packet_info.Add(packet.Timestamp.ToString("hh:mm:ss.fff tt"));
packet_info.Add(arp.SenderProtocolIpV4Address.ToString());
packet_info.Add(arp.TargetProtocolIpV4Address.ToString());
packet_info.Add(ethernet.Source.ToString());
packet_info.Add(ethernet.Destination.ToString());
packet_info.Add("ARP");
packet_info.Add(arp.Length.ToString());
// update UI
if (item != null) {
item.SubItems.AddRange(packet_info.ToArray());
object[] param = new object[2];
param[0] = frames;
object[] o = new object[3];
o[0] = item;
o[1] = ctrl[1];
o[2] = packet;
param[1] = o;
frames.BeginInvoke(new ParserHelper.UIHandlerEx(ParserHelper.UpdateFrameUI), param);
}
}
示例2: ValidaCuentaBancaria
/// <summary>
/// Validación de una cuenta bancaria española
/// </summary>
/// <param name="banco">Código del banco</param>
/// <param name="oficina">Código de la oficina</param>
/// <param name="dc">Dígito de control</param>
/// <param name="cuenta">Número de cuenta</param>
/// <returns>true si el número de cuenta es correcto</returns>
public static bool ValidaCuentaBancaria(UInt64 banco, UInt64 oficina, UInt64 dc, UInt64 cuenta)
{
return ValidaCuentaBancaria(
banco.ToString("0000")
, oficina.ToString("0000")
, dc.ToString("00")
, cuenta.ToString("0000000000")
);
}
示例3: Conflict
// Overload for Addresses to calculate a string resource representation
public Conflict(string device1, string device2, UInt64 startAddress, UInt64 endAddress)
{
// Convert each address to hex
string resource = "0x" + startAddress.ToString("X");
resource += "-0x" + endAddress.ToString("X");
this.Device1 = device1;
this.Device2 = device2;
this.Resource = resource;
}
示例4: GetNext
private UInt64 GetNext(UInt64 num)
{
string numAsString = num.ToString();
UInt64 total = 0;
for (int i = 0; i < numAsString.Length; i++) {
UInt64 x = Convert.ToUInt64(numAsString.Substring(i, 1));
total += x * x;
}
return total;
}
示例5: GetAnswer
public string GetAnswer()
{
_squareSize = 1;
_number = 1;
_diagonals.Add(1);
do {
AddNewLayer();
} while (Convert.ToDecimal(_primeCount) / Convert.ToDecimal(_diagonals.Count) >= Convert.ToDecimal(.1));
return _squareSize.ToString();
}
示例6: HandleIPV4
/// <summary>
/// Handle IPV4 packets, including TCP and UDP packets
/// </summary>
/// <param name="packet">The IpV4Datagram to parse</param>
public static void HandleIPV4(Packet packet, IpV4Datagram ip,
ref UInt64 frame_id, object[] ctrl)
{
ListViewItem item = new ListViewItem(frame_id.ToString());
frame_id++;
List<string> packet_info = new List<string>();
ListView frames = (ListView)ctrl[0];
EthernetDatagram ethernet = packet.Ethernet;
switch (ip.Protocol) {
case IpV4Protocol.Udp: {
UdpDatagram udp = ip.Udp;
packet_info.Add(packet.Timestamp.ToString("hh:mm:ss.fff tt"));
packet_info.Add(ip.Source + ":" + udp.SourcePort);
packet_info.Add(ip.Destination + ":" + udp.DestinationPort);
packet_info.Add(ethernet.Source.ToString());
packet_info.Add(ethernet.Destination.ToString());
packet_info.Add("UDP");
packet_info.Add(udp.Length.ToString());
break;
}
case IpV4Protocol.Tcp: {
TcpDatagram tcp = ip.Tcp;
packet_info.Add(packet.Timestamp.ToString("hh:mm:ss.fff tt"));
packet_info.Add(ip.Source + ":" + tcp.SourcePort);
packet_info.Add(ip.Destination + ":" + tcp.DestinationPort);
packet_info.Add(ethernet.Source.ToString());
packet_info.Add(ethernet.Destination.ToString());
packet_info.Add("TCP");
packet_info.Add(tcp.Length.ToString());
break;
}
default: {
item = null;
break;
}
}
// update UI
if (item != null) {
item.SubItems.AddRange(packet_info.ToArray());
object[] param = new object[2];
param[0] = frames;
object[] o = new object[3];
o[0] = item;
o[1] = ctrl[1];
o[2] = packet;
param[1] = o;
frames.BeginInvoke(new ParserHelper.UIHandlerEx(ParserHelper.UpdateFrameUI), param);
}
}
示例7: Address
public Address(string address,string offset)
{
address = FormatAddress(address);
UInt64 off;
if (!UInt64.TryParse(offset, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out off))
throw new Exception("invalid address: " + offset);
if (!UInt64.TryParse(address, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out _address))
throw new Exception("invalid address: " + address);
_address = _address + off;
_hexaddress = _address.ToString("X");
}
示例8: Convert
/// <summary>
/// Convert a number to another base system
/// </summary>
public static string Convert(UInt64 number, IdBase radix)
{
switch (radix)
{
case IdBase.Hexadecimal:
return number.ToString("X");
case IdBase.Hexatrigesimal:
return Convert(number, Characters.Hexatrigesimal);
case IdBase.Sexagesimal:
return Convert(number, Characters.Sexagesimal);
case IdBase.Duosexagesimal:
return Convert(number, Characters.Duosexagesimal);
case IdBase.WebId:
return Convert(number, Characters.ShortIdTable);
}
throw new Exception("Not handle " + radix);
}
示例9: setTotal
public void setTotal(UInt64 newTotal)
{
string strTotal = (this.txbxTotalClicks.Text);
UInt64 total = Convert.ToUInt64(strTotal);
total = newTotal;
this.txbxTotalClicks.Text = total.ToString();
}
示例10: IntToHex
public static string IntToHex(UInt64 value, int digits)
{
return value.ToString("X").PadLeft(digits, '0');
}
示例11: OSUInt64ToString
public static unsafe string OSUInt64ToString(UInt64 n, string s, CultureInfo ci)
{
if (Utilities.IsWindows)
{
NumberFormatInfo nfi = NumberFormatInfoFromLCID(LCIDFromCultureInfo(ci));
return n.ToString(s, nfi);
}
else
{
return OSNumberToStringMac(new IntPtr((void*)&n), s, ci, CFNumberType.kCFNumberLongLongType, n);
}
}
示例12: TypeUUID
public TypeUUID(UInt64 myUInt64)
: this(myUInt64.ToString())
{
}
示例13: ToChars
static public int ToChars(UInt64 value, byte[] buffer, int offset)
{
return ToAsciiChars(value.ToString(null, NumberFormatInfo.InvariantInfo), buffer, offset);
}
示例14: TestToString
public Boolean TestToString(UInt64 testSubject) {
strLoc = "3498d";
String b1 = "";
String b2 = "";
Boolean pass = false;
Boolean excthrown = false;
Object exc1 = null;
Object exc2 = null;
try {
b1 = testSubject.ToString();
pass = true;
excthrown = false;
} catch (Exception exc) {
exc1 = exc;
pass = false;
excthrown = true;
}
try {
b2 = Convert.ToString(testSubject);
pass = pass & true;
excthrown = false;
} catch (Exception exc) {
exc2 = exc;
pass = false;
excthrown = excthrown & true;
}
if(excthrown)
if(exc1.GetType() == exc2.GetType())
return true;
else
return false;
else if(pass && b1.Equals(b2))
return true;
else
return false;
}
示例15: ToString
public static string ToString(UInt64 value)
{
return value.ToString(CultureInfo.InvariantCulture);
}