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


C# UInt64.ToString方法代码示例

本文整理汇总了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);
			}

		}
开发者ID:d3xt3-bitstechlab,项目名称:sniffer,代码行数:36,代码来源:ArpParser.cs

示例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")
                         );
 }
开发者ID:mondedos,项目名称:facturasmarianoconchi,代码行数:17,代码来源:CuentaBancariaValidador.cs

示例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;
 }
开发者ID:CJxD,项目名称:CoreView,代码行数:10,代码来源:SoftwareContainers.cs

示例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;
 }
开发者ID:enigmaticcam,项目名称:ProjectEuler,代码行数:10,代码来源:Problem92.cs

示例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();
 }
开发者ID:enigmaticcam,项目名称:ProjectEuler,代码行数:10,代码来源:Problem58.cs

示例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);
			}
		}
开发者ID:d3xt3-bitstechlab,项目名称:sniffer,代码行数:57,代码来源:IPParser.cs

示例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");
 }
开发者ID:rohithkrajan,项目名称:ExtCS,代码行数:12,代码来源:Address.cs

示例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);
        }
开发者ID:netvietdev,项目名称:RabbitFoundation,代码行数:21,代码来源:NumberToString.cs

示例9: setTotal

 public void setTotal(UInt64 newTotal)
 {
     string strTotal = (this.txbxTotalClicks.Text);
     UInt64 total = Convert.ToUInt64(strTotal);
     total = newTotal;
     this.txbxTotalClicks.Text = total.ToString();
 }
开发者ID:SaddlebackCSS,项目名称:antiClicker,代码行数:7,代码来源:Form1.cs

示例10: IntToHex

 public static string IntToHex(UInt64 value, int digits)
 {
     return value.ToString("X").PadLeft(digits, '0');
 }
开发者ID:LeonCheung,项目名称:subtitleedit,代码行数:4,代码来源:Helper.cs

示例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);
     }
 }
开发者ID:CheneyWu,项目名称:coreclr,代码行数:12,代码来源:GlobLocHelper.cs

示例12: TypeUUID

 public TypeUUID(UInt64 myUInt64)
     : this(myUInt64.ToString())
 {
 }
开发者ID:TheByte,项目名称:sones,代码行数:4,代码来源:TypeUUID.cs

示例13: ToChars

 static public int ToChars(UInt64 value, byte[] buffer, int offset)
 {
     return ToAsciiChars(value.ToString(null, NumberFormatInfo.InvariantInfo), buffer, offset);
 }
开发者ID:geoffkizer,项目名称:corefx,代码行数:4,代码来源:XmlConverter.cs

示例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;
 }	
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:36,代码来源:co5721iconvertible_uint64.cs

示例15: ToString

		public static string ToString(UInt64 value)
		{
			return value.ToString(CultureInfo.InvariantCulture);
		}
开发者ID:GirlD,项目名称:mono,代码行数:4,代码来源:XmlConvert.cs


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