//출처 https://hellocho.tistory.com/11
//추가 문자 인코딩이기 때문에 인코딩 등록자 지정이 필요하다고 함
var client = new WebClient();
int euckrCode = 51949;
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
client.Encoding = System.Text.Encoding.GetEncoding(euckrCode);
string strHtml = client.DownloadString("http://kind.krx.co.kr/corpgeneral/corpList.do?method=download");
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MyCapture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
Rectangle rc = new Rectangle();
foreach (var item in Screen.AllScreens)
{
rc = Rectangle.Union(rc, item.Bounds);
}
Bitmap bmp = new Bitmap(rc.Width, rc.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(rc.Location, Point.Empty, bmp.Size);
}
bmp.Save(@"sshot.png", ImageFormat.Png);
}
}
}