using System;
using System.Net;
using System.IO;
namespace NetKingdom
{
class Program
{
static WebRequest request;
static WebResponse response;
static Stream dataStream;
static StreamReader reader;
static void Main(string[] args)
{
request = WebRequest.Create("https://news.naver.com");//URL ADDRESS
request.Method = "GET";
response = request.GetResponse();
dataStream = response.GetResponseStream();
reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer); // response 출력
reader.Close();
dataStream.Close();
response.Close();
}
}
}
'c# 언어' 카테고리의 다른 글
SendMessage by User Forced & When F1 KeyDown, Process ex (0) | 2021.06.17 |
---|---|
WndProc & Message(WM_MOVE) 예제 (0) | 2021.06.16 |
메시지 처리 함수 (WndProc) (0) | 2021.06.08 |
#region을 사용하면 #endregion으로 지시문을 종료해야 합니다. (0) | 2021.06.04 |
Integer.ToString("formatting") (0) | 2021.06.02 |