Posted
Filed under .NET/C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Text.RegularExpressions;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            WebClient wc = new WebClient();
            wc.Encoding = System.Text.Encoding.Default;
            string html = wc.DownloadString("http://ipip.kr");

            Regex regex = new Regex(@"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}");
            Match m = regex.Match(html);

            Console.WriteLine(m.ToString());
        }
    }
}
[관련] http://bluene.net/blog/547 - C# 자신의 IP 주소 확인하기
2015/05/21 09:02 2015/05/21 09:02