MCConnectionForwarder/Connection forwarder/Program.cs

37 lines
914 B
C#
Raw Permalink Normal View History

2016-06-15 21:36:57 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
2016-06-15 21:42:34 +00:00
using System.Threading;
2016-06-15 21:36:57 +00:00
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Connection_forwarder
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
2016-06-16 10:43:44 +00:00
Console.WriteLine(":P");
2016-06-15 21:36:57 +00:00
}
public static IPAddress GetLocalIP()
{
IPHostEntry host;
IPAddress localIP = IPAddress.Parse("127.0.0.1");
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip;
}
}
return localIP;
}
}
}