Skip to content

Instantly share code, notes, and snippets.

@RyuaNerin
Created March 1, 2014 16:25
Show Gist options
  • Save RyuaNerin/9292315 to your computer and use it in GitHub Desktop.
Save RyuaNerin/9292315 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace BankHttps
{
class Program
{
static int Main(string[] args)
{
Console.WriteLine("국민 : " + (test("www.kbstar.com") ? "O" : " X"));
Console.WriteLine("우리 : " + (test("www.wooribank.com") ? "O" : " X"));
Console.WriteLine("신한 : " + (test("www.shinhan.com") ? "O" : " X"));
Console.WriteLine("하나 : " + (test("www.hanabank.com") ? "O" : " X"));
Console.WriteLine("씨티 : " + (test("www.citibank.co.kr") ? "O" : " X"));
Console.WriteLine("외환 : " + (test("www.keb.co.kr") ? "O" : " X"));
Console.WriteLine("HSBC : " + (test("www.hsbc.co.kr") ? "O" : " X"));
Console.WriteLine("기업 : " + (test("www.ibk.co.kr") ? "O" : " X"));
Console.WriteLine("경남 : " + (test("www.knbank.co.kr") ? "O" : " X"));
Console.WriteLine("스탠다드차타드 : " + (test("www.standardchartered.co.kr") ? "O" : " X"));
Console.WriteLine("수협중앙회 : " + (test("www.suhyup.co.kr") ? "O" : " X"));
Console.WriteLine("부산 : " + (test("www.busanbank.co.kr") ? "O" : " X"));
Console.WriteLine("전북 : " + (test("www.jbbank.co.kr") ? "O" : " X"));
Console.WriteLine("산업 : " + (test("www.kdb.co.kr") ? "O" : " X"));
Console.WriteLine("제주 : " + (test("www.e-jejubank.com") ? "O" : " X"));
Console.WriteLine("한국 : " + (test("www.bok.or.kr") ? "O" : " X"));
Console.WriteLine("수협 : " + (test("www.suhyup-bank.com") ? "O" : " X"));
Console.WriteLine("광주 : " + (test("www.kjbank.com") ? "O" : " X"));
Console.WriteLine("신협 : " + (test("www.bank.cu.co.kr") ? "O" : " X"));
Console.WriteLine("새마을 : " + (test("www.kfcc.co.kr") ? "O" : " X"));
return 0;
}
class CWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
WebRequest req = base.GetWebRequest(address) as WebRequest;
req.Timeout = 3000;
return req;
}
}
static bool test(string url)
{
using (CWebClient wc = new CWebClient())
{
try
{
wc.DownloadString("https://" + url);
return true;
}
catch
{
return false;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment