コード例 #1
0
ファイル: Program.cs プロジェクト: radtek/autoxx
        public static void Run()
        {
            while (true)
            {
                try
                {
                    //BTC.Do();
                    BCH.Do();
                    ETH.Do();
                    ETC.Do();
                    LTC.Do();

                    EOS.Do();
                    XRP.Do();
                    OMG.Do();
                    DASH.Do();
                    ZEC.Do();
                    Thread.Sleep(1000 * 5);

                    // 创新
                    ITC.Do();
                    NAS.Do();
                    RUFF.Do();
                    ZIL.Do();
                    DTA.Do();
                    Thread.Sleep(1000 * 5);

                    LET.Do();
                    HT.Do();
                    THETA.Do();
                    HSR.Do();
                    QTUM.Do();
                    Thread.Sleep(1000 * 5);

                    SNT.Do();
                    IOST.Do();
                    NEO.Do();
                    STORJ.Do();
                    GNT.Do();
                    Thread.Sleep(1000 * 5);

                    CVC.Do();
                    SMT.Do();
                    VEN.Do();
                    ELF.Do();
                    XEM.Do();
                    Thread.Sleep(1000 * 5);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
コード例 #2
0
ファイル: Admin.cs プロジェクト: ummarhussain/Project
        private void ListItemClicked(int position)
        {
            //this way we don't load twice, but you might want to modify this a bit.
            if (position == oldPosition)
            {
                return;
            }

            oldPosition = position;

            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = manager.NewInstance();
                break;

            case 1:
                fragment = Customers.NewInstance();
                break;

            case 2:
                fragment = Area.NewInstance();
                break;

            case 3:
                fragment = City.NewInstance();
                break;

            case 4:
                fragment = IP_Pool.NewInstance();
                break;

            case 5:
                fragment = NAS.NewInstance();
                break;

            case 6:
                fragment = Packages.NewInstance();
                break;

            case 7:
                fragment = about.NewInstance();
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
コード例 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="filePath"></param>
        static (double, DateTime) doSomthingWithTheFile(string filePath)
        {
            const string _streamName = "_314159265_";

            if (NAS.HasStream(filePath, _streamName))
            {
                var b = NAS.ReadStream(filePath, _streamName);
                if (b.Length >= 16)
                {
                    return(BitConverter.ToDouble(b, 0), DateTime.FromBinary(BitConverter.ToInt64(b, 8)));
                }
            }

            var       sum          = 0L;
            var       counter      = 0L;
            const int bufferLength = 1024 * 1024 * 100;//100MiB
            var       buffer       = new byte[bufferLength];

            using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Write | FileAccess.Read))
            {
                while (true)
                {
                    var readLen = fs.Read(buffer, 0, bufferLength);
                    if (readLen <= 0)
                    {
                        break;
                    }

                    for (int i = 0; i < readLen; i++)
                    {
                        sum += buffer[i];
                    }
                    counter += readLen;

                    //for (int i = 0; i < readLen; i++) buffer[i] = (byte)(buffer[i] ^ 0);
                    //fs.Write(buffer, 0, readLen);
                }
                fs.Close();
            }

            var list = new List <byte>();

            (var avg, var time) = (Math.Round(sum / (double)counter, 3), DateTime.UtcNow);
            list.AddRange(BitConverter.GetBytes(avg));
            list.AddRange(BitConverter.GetBytes(time.ToBinary()));

            NAS.WriteStream(filePath, _streamName, list.ToArray());
            return(avg, time);
        }