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


C# IPAddress.?.ToString方法代码示例

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


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

示例1: Parse

 public SyslogMessage Parse(string rawmessage, IPAddress address)
 {
     var message = GetMessage(rawmessage);
     var severity = GetSeverity(rawmessage);
     var datetime = GetDateTime(rawmessage);
     var facility = GetFacility(rawmessage);
     var sm = new SyslogMessage(message, severity, datetime, address?.ToString() ?? string.Empty, facility);
     return sm;
 }
开发者ID:mchudinov,项目名称:Syslog,代码行数:9,代码来源:MessageParser.cs

示例2: GroupEvent

        /// <summary>
        /// Posts an event to the specified group.
        /// </summary>
        /// <param name="groupName">Groupname of the steam group.</param>
        /// <param name="eventName">The name of the event.</param>
        /// <param name="eventNotes">The notes of the event.</param>
        /// <param name="timeChoice">"quick" which means now, or "specific" which means will start at the given date/time.</param>
        /// <param name="startMinute">The minute of the event date. EX: 30</param>
        /// <param name="startHour">The hour of the event date. EX: 10</param>
        /// <param name="startDate">The date of the event. MM/DD/YY EX: 12/20/18</param>
        /// <param name="startAMPM">AM or PM of the event date.</param>
        /// <param name="serverPassword">Password to the server.</param>
        /// <param name="serverIP">Ip of the server.</param>
        /// <param name="appID">The game associated with the event.</param>
        /// <returns>no return</returns>
        public IResponse GroupEvent(string groupName, string eventName, string eventNotes, string eventType, DateTime startDateAndTime,
                               string timeChoice = "quick", string serverPassword = "", IPAddress serverAddress = null, int appId = -1, int timezoneOffset = -18000)
        {
            string url = "http://steamcommunity.com/groups/" + groupName + "/eventEdit";

            string sessionid =
                (from Cookie cookie in _account.AuthContainer.GetCookies(new Uri("https://steamcommunity.com"))
                 where cookie.Name == "sessionid"
                 select cookie.Value).FirstOrDefault();

            var data = new Dictionary<string, string>
            {
                {"sessionid", sessionid},
                {"tzOffset", timezoneOffset.ToString()},
                {"type", eventType}, // What type of event? BroadcastEvent, Chat, etc
                {"timeChoice", timeChoice}, // "quick" which means now, or "specific" which means will start at the given date/time
                {"startMinute", startDateAndTime.TimeOfDay.Minutes.ToString()},
                {"startHour", startDateAndTime.TimeOfDay.Hours.ToString()},
                {"startDate", startDateAndTime.ToString("MM/DD/YY")},
                {"startAMPM", startDateAndTime.TimeOfDay.Hours >= 12 ? "PM" : "AM" },
                {"serverPassword", serverPassword},
                {"serverIP", serverAddress?.ToString() ?? ""},
                {"name", eventName}, // Title of the event
                {"notes", eventNotes}, // Notes of the event
                {"eventQuickTime", "now"},
                {"appID", appId == -1 ? "" : appId.ToString()}, // The game you want the event associated with
                {"action", "newEvent"}
            };

            return _web.Fetch(url, "POST", data, _account.AuthContainer, true, url);
        }
开发者ID:FatherFoxxy,项目名称:CSharpTradeOffers,代码行数:46,代码来源:CommunityHandler.cs


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