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


C# System.Int64类代码示例

本文整理汇总了C#中System.Int64的典型用法代码示例。如果您正苦于以下问题:C# Int64类的具体用法?C# Int64怎么用?C# Int64使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Int64类属于System命名空间,在下文中一共展示了Int64类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: highlightStuff

        public void highlightStuff(string[] fileContent, Int64 seconds, Player p)
        {
            Player.UndoPos Pos;

            for (int i = fileContent.Length / 7; i >= 0; i--)
            {
                try
                {
                    if (Convert.ToDateTime(fileContent[(i * 7) + 4].Replace('&', ' ')).AddSeconds(seconds) >= DateTime.Now)
                    {
                        Level foundLevel = Level.Find(fileContent[i * 7]);
                        if (foundLevel != null && foundLevel == p.level)
                        {
                            Pos.mapName = foundLevel.name;
                            Pos.x = Convert.ToUInt16(fileContent[(i * 7) + 1]);
                            Pos.y = Convert.ToUInt16(fileContent[(i * 7) + 2]);
                            Pos.z = Convert.ToUInt16(fileContent[(i * 7) + 3]);

                            Pos.type = foundLevel.GetTile(Pos.x, Pos.y, Pos.z);

                            if (Pos.type == Convert.ToByte(fileContent[(i * 7) + 6]) || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
                            {
                                if (Pos.type == Block.air || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
                                    p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.red);
                                else p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.green);
                            }
                        }
                    }
                    else break;
                }
                catch { }
            }
        }
开发者ID:blingbling4567,项目名称:MCDawn,代码行数:33,代码来源:CmdHighlight.cs

示例2: StepsToMiles

				public static float StepsToMiles(Int64 stepCount)
				{
					if (stepCount <= 0) return 0.00f;
					//Average steps in a mile
					const float stepsPerMile = 2000;
					return stepCount/stepsPerMile;
				}
开发者ID:jamaher,项目名称:My-StepCounter,代码行数:7,代码来源:Conversion.cs

示例3: IsNetworkAvailable

        /// <summary>
        /// Indicates whether any network connection is available.
        /// Filter connections below a specified speed, as well as virtual network cards.
        /// </summary>
        /// <param name="minimumSpeed">The minimum speed required. Passing 0 will not filter connection using speed.</param>
        /// <returns>True if a network connection is available; otherwise false.</returns>
        public static Boolean IsNetworkAvailable(Int64 minimumSpeed)
        {
            if (NetworkInterface.GetIsNetworkAvailable())
            {
                foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
                {
                    // discard because of standard reasons
                    if ((ni.OperationalStatus != OperationalStatus.Up) ||
                        (ni.NetworkInterfaceType == NetworkInterfaceType.Loopback) ||
                        (ni.NetworkInterfaceType == NetworkInterfaceType.Tunnel))
                        continue;

                    // this allow to filter modems, serial, etc.
                    // I use 10000000 as a minimum speed for most cases
                    if (ni.Speed < minimumSpeed)
                        continue;

                    // discard virtual cards (virtual box, virtual pc, etc.)
                    if ((ni.Description.IndexOf("virtual", StringComparison.OrdinalIgnoreCase) >= 0) ||
                        (ni.Name.IndexOf("virtual", StringComparison.OrdinalIgnoreCase) >= 0))
                        continue;

                    // discard "Microsoft Loopback Adapter", it will not show as NetworkInterfaceType.Loopback but as Ethernet Card.
                    if (ni.Description.Equals("Microsoft Loopback Adapter", StringComparison.OrdinalIgnoreCase))
                        continue;

                    return true;
                }
            }

            return false;
        }
开发者ID:Wojdav,项目名称:AngleSharp,代码行数:38,代码来源:Helper.cs

示例4: GetBestAddress

        public static bool GetBestAddress(Int64 APartnerKey,
            out PLocationTable AAddress,
            out string ACountryNameLocal)
        {
            bool NewTransaction;
            TDBTransaction Transaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.ReadCommitted,
                TEnforceIsolationLevel.eilMinimum, out NewTransaction);

            bool ResultValue = false;

            try
            {
                ResultValue = TAddressTools.GetBestAddress(APartnerKey,
                    out AAddress,
                    out ACountryNameLocal,
                    Transaction);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (NewTransaction)
                {
                    DBAccess.GDBAccessObj.RollbackTransaction();
                }
            }
            return ResultValue;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:30,代码来源:AddressTools.WebConnector.cs

示例5: Partition

 public Partition( Device device, MBRPartitionEntry entry )
 {
     this.device         = device;
     partition_id        = entry.id;
     partition_start     = ( Int64 ) entry.start_lba * ( Int64 ) device.SectorSize;
     partition_length    = ( Int64 ) entry.size_lba * ( Int64 ) device.SectorSize;
 }
开发者ID:pbalint,项目名称:Playground,代码行数:7,代码来源:Partition.cs

示例6: ValueVersion

        public ValueVersion(UInt64 ve, string ss, byte[] va, int ec, ProcessStatus status, Int64 start, Int64 stop)
        {
            version = ve;
            shortStatus = ss;
            value = va;
            exitCode = ec;
            startTime = start;
            stopTime = stop;
            switch (status)
            {
                case ProcessStatus.Queued:
                    processStatus = "Queued";
                    break;

                case ProcessStatus.Running:
                    processStatus = "Running";
                    break;

                case ProcessStatus.Canceling:
                    processStatus = "Canceling";
                    break;

                default:
                    processStatus = "Completed";
                    break;
            }
        }
开发者ID:knowledgehacker,项目名称:Dryad,代码行数:27,代码来源:ProcessService.cs

示例7: GetHashFinalBlock

        private static byte[] GetHashFinalBlock(byte[] input, int ibStart, int cbSize, ABCDStruct ABCD, Int64 len)
        {
            byte[] working = new byte[64];
            byte[] length = BitConverter.GetBytes(len);

            //Padding is a single bit 1, followed by the number of 0s required to make size congruent to 448 modulo 512. Step 1 of RFC 1321  
            //The CLR ensures that our buffer is 0-assigned, we don't need to explicitly set it. This is why it ends up being quicker to just
            //use a temporary array rather then doing in-place assignment (5% for small inputs)
            Array.Copy(input, ibStart, working, 0, cbSize);
            working[cbSize] = 0x80;

            //We have enough room to store the length in this chunk
            if (cbSize <= 56)
            {
                Array.Copy(length, 0, working, 56, 8);
                GetHashBlock(working, ref ABCD, 0);
            }
            else  //We need an aditional chunk to store the length
            {
                GetHashBlock(working, ref ABCD, 0);
                //Create an entirely new chunk due to the 0-assigned trick mentioned above, to avoid an extra function call clearing the array
                working = new byte[64];
                Array.Copy(length, 0, working, 56, 8);
                GetHashBlock(working, ref ABCD, 0);
            }
            byte[] output = new byte[16];
            Array.Copy(BitConverter.GetBytes(ABCD.A), 0, output, 0, 4);
            Array.Copy(BitConverter.GetBytes(ABCD.B), 0, output, 4, 4);
            Array.Copy(BitConverter.GetBytes(ABCD.C), 0, output, 8, 4);
            Array.Copy(BitConverter.GetBytes(ABCD.D), 0, output, 12, 4);
            return output;
        }
开发者ID:tianzhaodong,项目名称:uwp_AiJianShu,代码行数:32,代码来源:MD5Core.cs

示例8: PlanningOfficerMessage

 public PlanningOfficerMessage(string message, Int64 customerMobile, DateTime dateSent, string connectionString)
 {
     Message = message;
     CustomerMobile = customerMobile;
     DateSent = dateSent;
     _connectionString = connectionString;
 }
开发者ID:MarneeDear,项目名称:Terminal-Management-Applications,代码行数:7,代码来源:Messageing.SMS.cs

示例9: QuickIOTransferFileCopyFinishedEventArgs

 /// <summary>
 /// Creates new instance of <see cref="QuickIOTransferFileCopyProgressEventArgs"/>
 /// </summary>
 /// <param name="job">Affected job</param>
 /// <param name="sourcePath">Source file path</param>
 /// <param name="targetPath">Target file path</param>
 /// <param name="totalBytes">Total bytes to transfer</param>
 /// <param name="transferStarted"></param>
 public QuickIOTransferFileCopyFinishedEventArgs( IQuickIOTransferJob job, string sourcePath, string targetPath, Int64 totalBytes, DateTime transferStarted )
     : base(job, sourcePath, targetPath)
 {
     TotalBytes = ( UInt64 ) totalBytes;
     TransferStarted = transferStarted;
     TransferFinished = DateTime.Now;
 }
开发者ID:Kudach,项目名称:QuickIO,代码行数:15,代码来源:QuickIOTransferFileCopyFinishedEventArgs.cs

示例10: GetProduct

        public Product GetProduct(Int64 id)
        {
            var products = new List<Product>();
            using (var conn = _getConnection())
            {
                conn.Open();
                using (var cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "SELECT * FROM Products WHERE Id = @Id order by Name";
                    cmd.Parameters.Add(new SqlParameter("Id", System.Data.SqlDbType.BigInt) { Value = id });
                    using (var reader = cmd.ExecuteReader())
                    {
                        if (!reader.Read())
                        {
                            return null;
                        }

                        return new Product
                        {
                            Id = (Int64)reader["Id"],
                            Name = reader["Name"].ToString(),
                            Description = reader["Description"].ToString(),
                            Title1 = reader["Title1"].ToString(),
                            Title2 = reader["Title2"].ToString(),
                            TitlesCount = (int)(reader["TitlesCount"] ?? 0),
                            Price = (int)reader["Price"]
                        };
                    }
                }
            }
        }
开发者ID:CarlRabeler,项目名称:WingTipTickets,代码行数:31,代码来源:ProductsRepository.cs

示例11: GetSongPlayCount

        public int GetSongPlayCount(Int64 productId, Int64 customerId)
        {
            var playCount = 0;
            using (var conn = _getConnection())
            {
                conn.Open();
                using (var cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "SELECT Sum(CU.IsPlayed) as PlayCount FROM CustomerUsage CU WHERE Cu.CustomerId = @CustomerId AND Cu.ProductId = @ProductId";
                    cmd.Parameters.Add(new SqlParameter("CustomerId", System.Data.SqlDbType.BigInt) { Value = customerId });
                    cmd.Parameters.Add(new SqlParameter("ProductId", System.Data.SqlDbType.BigInt) { Value = productId });
                    using (var reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            if (!DBNull.Value.Equals(reader["PlayCount"]))
                            {
                                playCount = (int) (reader["PlayCount"]);
                            }
                            else
                            {
                                playCount = 0;
                            }
                        }
                    }
                }
            }

            return playCount;
        }
开发者ID:CarlRabeler,项目名称:WingTipTickets,代码行数:30,代码来源:ProductsRepository.cs

示例12: switch

        void IStream.Seek(Int64 offset, Int32 origin, IntPtr newPositionPtr)
        {
            SeekOrigin  seekOrigin;

            // The operation will generally be I/O bound, so there is no point in
            // eliminating the following switch by playing on the fact that
            // System.IO uses the same integer values as IStream for SeekOrigin.
            switch(origin)
            {
                case NativeMethods.STREAM_SEEK_SET:
                    seekOrigin = SeekOrigin.Begin;
                    break;
                case NativeMethods.STREAM_SEEK_CUR:
                    seekOrigin = SeekOrigin.Current;
                    break;
                case NativeMethods.STREAM_SEEK_END:
                    seekOrigin = SeekOrigin.End;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("origin");
            }
            long position = _ioStream.Seek(offset, seekOrigin);

            // Dereference newPositionPtr and assign to the pointed location.
            if (newPositionPtr != IntPtr.Zero)
            {
                Marshal.WriteInt64(newPositionPtr, position);
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:29,代码来源:ManagedIStream.cs

示例13: PercentageOf

        /// <summary>
        ///     Gets the specified percentage of the number.
        /// </summary>
        /// <param name="number">The number.</param>
        /// <param name="percent">The percent.</param>
        /// <returns>Returns the specified percentage of the number</returns>
        public static Double PercentageOf( this Int64 number, Int64 percent )
        {
            if ( number <= 0 )
                throw new DivideByZeroException( "The number must be greater than zero." );

            return (Double) number * percent / 100;
        }
开发者ID:MannusEtten,项目名称:Extend,代码行数:13,代码来源:Int64.PercentageOf.cs

示例14: Trip

 public Trip(BinaryReader byteFile)
 {
     this.Time = byteFile.ReadInt64();
     this.TimeDT = new DateTime(this.Time);
     this.Comment = byteFile.ReadString();
     this.declination = byteFile.ReadInt16();
 }
开发者ID:MaticDiba,项目名称:TopSharp,代码行数:7,代码来源:Trip.cs

示例15: getCliente

        public static Cliente getCliente(Int64 id_cliente)
        {
            //creo la conexion
            SqlConnection cnn = new SqlConnection(conexion);
            //abro la conexion
            cnn.Open();
            //creo la lista para almacenar las personas
             Cliente c = new Cliente();
            //Creo el comando sql a utlizar
            SqlCommand cmd = new SqlCommand("select c.id_cliente, c.nombre, c.documento, c.telefono, c.email, c.direccion, c.ciudad, c.id_pais, p.nombre, c.rut, c.nacimiento from cliente c, pais p where c.id_pais = p.id_pais and id_cliente = @id_cliente");
            cmd.Parameters.Add(new SqlParameter("@id_cliente", id_cliente));

            //asigno la conexion al comando
            cmd.Connection = cnn;
            //creo el datareader
            SqlDataReader obdr = cmd.ExecuteReader();
            //recorro el datareader
            while (obdr.Read())
            {

                c.Nombre = obdr.GetString(1);

            }

            //Cierro la conexion
            cnn.Close();
            //retorno la lsita
            return c;
        }
开发者ID:EstebanLL,项目名称:Sistema_de_Ventas,代码行数:29,代码来源:DatosCliente.cs


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