36 lines
914 B
C#
36 lines
914 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Sockets;
|
|
using System.Threading;
|
|
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()
|
|
{
|
|
Console.WriteLine(":P");
|
|
}
|
|
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;
|
|
}
|
|
}
|
|
}
|