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


C# Int64.Select方法代码示例

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


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

示例1: hash

        public override ulong hash(object key)
        {
            Int64 i, j;
            Int64[] hh = new Int64[8];
            string value = key.ToString();
            var T = new[] {
              // 256 values 0-255 in any (random) order suffices
               98,  6, 85,150, 36, 23,112,164,135,207,169,  5, 26, 64,165,219, //  1
               61, 20, 68, 89,130, 63, 52,102, 24,229,132,245, 80,216,195,115, //  2
               90,168,156,203,177,120,  2,190,188,  7,100,185,174,243,162, 10, //  3
              237, 18,253,225,  8,208,172,244,255,126,101, 79,145,235,228,121, //  4
              123,251, 67,250,161,  0,107, 97,241,111,181, 82,249, 33, 69, 55, //  5
               59,153, 29,  9,213,167, 84, 93, 30, 46, 94, 75,151,114, 73,222, //  6
              197, 96,210, 45, 16,227,248,202, 51,152,252,125, 81,206,215,186, //  7
               39,158,178,187,131,136,  1, 49, 50, 17,141, 91, 47,129, 60, 99, //  8
              154, 35, 86,171,105, 34, 38,200,147, 58, 77,118,173,246, 76,254, //  9
              133,232,196,144,198,124, 53,  4,108, 74,223,234,134,230,157,139, // 10
              189,205,199,128,176, 19,211,236,127,192,231, 70,233, 88,146, 44, // 11
              183,201, 22, 83, 13,214,116,109,159, 32, 95,226,140,220, 57, 12, // 12
              221, 31,209,182,143, 92,149,184,148, 62,113, 65, 37, 27,106,166, // 13
                3, 14,204, 72, 21, 41, 56, 66, 28,193, 40,217, 25, 54,179,117, // 14
              238, 87,240,155,180,170,242,212,191,163, 78,218,137,194,175,110, // 15
               43,119,224, 71,122,142, 42,160,104, 48,247,103, 15, 11,138,239  // 16
              };
            for (j = 0; j < 8; j++)
            {
                int h = T[(value[0] + j) % 256];
                for (i = 1; i < value.Length; i++)
                {
                    h = T[h ^ value[(int)i]];
                }
                hh[j] = h;
            }

            var bytes = hh.Select(h => System.Convert.ToByte(h)).ToArray();
            return (ulong)System.BitConverter.ToInt64(bytes, 0);
        }
开发者ID:dialectsoftware,项目名称:BigData.Net,代码行数:37,代码来源:P.cs

示例2: SendMessage

        /// <summary>
        /// SMS sending
        /// </summary>
        /// <param name="phone">Phone numbers</param>
        /// <param name="originator">Sender name</param>
        /// <param name="text">Sms text</param>
        /// <param name="sendingTime">An optional parameter, it is used when it is necessary to schedule SMS messages. Format YYYY-MM-DD HH:ii</param>
        /// <returns>Results list</returns>
        public List<MessageSendingResult> SendMessage(Int64[] phone, string originator, string text, string sendingTime = null)
        {
            var parameters = new NameValueCollection()
            {
                {"phone", String.Join(",", phone.Select(p => p.ToString()))},
                {"sender", originator},
                {"text", text}
            };
            if (sendingTime != null)
            {
                parameters.Add("sendingTime", sendingTime);
            }

            try
            {
                var content = GetStreamContent("send", parameters);

                var settings = new DataContractJsonSerializerSettings
                {
                    UseSimpleDictionaryFormat = true
                };

                var messages = new List<MessageSendingResult>();

                var serializer = new DataContractJsonSerializer(typeof(Dictionary<Int64, MessageSending>[]), settings);
                var items = serializer.ReadObject(content) as Dictionary<Int64, MessageSending>[];

                if (items == null)
                    return messages;

                foreach (var one in items)
                {
                    var item = one.First().Value;
                    item.Phone = one.First().Key;
                    if (item.Error == 0)
                    {
                        var success = new MessageSendingSuccess
                        {
                            Phone = item.Phone,
                            MessageId = item.MessageId,
                            MessagesCount = item.MessagesCount,
                            Cost = item.Cost,
                            Currency = item.Currency
                        };
                        messages.Add(success);
                    }
                    else
                    {
                        var error = new MessageSendingError
                        {
                            Phone = item.Phone,
                            Code = item.Error
                        };
                        messages.Add(error);
                    }
                }

                return messages;
            }
            catch (Exception ex)
            {
                throw new MessageSendingResultException(parameters, ex);
            }
        }
开发者ID:intistelecom,项目名称:Intis-Telecom-SDK-NET,代码行数:72,代码来源:IntisClient.cs

示例3: MakeHlrRequest

        /// <summary>
        /// Sending HLR request for number
        /// </summary>
        /// <param name="phone">Phone number</param>
        /// <returns>Results list</returns>
        public List<HlrResponse> MakeHlrRequest(Int64[] phone)
        {
            var parameters = new NameValueCollection()
            {
                {"phone", String.Join(",", phone.Select(p => p.ToString()))}
            };

            try
            {
                var content = GetStreamContent("hlr", parameters);

                var settings = new DataContractJsonSerializerSettings
                {
                    UseSimpleDictionaryFormat = true
                };

                var serializer = new DataContractJsonSerializer(typeof(List<HlrResponse>), settings);
                var items = serializer.ReadObject(content) as List<HlrResponse>;

                return items;
            }
            catch (Exception ex)
            {
                throw new HlrResponseException(parameters, ex);
            }
        }
开发者ID:intistelecom,项目名称:Intis-Telecom-SDK-NET,代码行数:31,代码来源:IntisClient.cs


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