本文整理匯總了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;
}
示例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);
}