C# + Unity

[C#] 기본 연결이 닫혔습니다. 보내기에서 예기치 않은 오류가 발생했습니다. 포스트 Teaser

[C#] 기본 연결이 닫혔습니다. 보내기에서 예기치 않은 오류가 발생했습니다.

카테고리:

최대 1 분 소요

문제 상황 C#에서 HttpWebRequest를 이용하여 서버와 통신할 때, ‘기본 연결이 닫혔습니다. 보내기에서 예기치 않은 오류가 발생했습니다.’와 같은 오류가 나온다면, 해결방법은 다음과 같다. 문제 해결 해당 프로젝트의 프레임워크 버전을 4.5.2이상으로 올린다. 아래 코드를 적용한다. ServicePointManager.SecurityProtocol |= SecurityProtocolType.Ssl3; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls; ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11; ServicePointManager.Secu

[C#] Excel 읽고 쓰기 포스트 Teaser

[C#] Excel 읽고 쓰기

카테고리:

3 분 소요

Nuget 패키지 추가 C#에서는 ‘Microsoft.Office.Interop.Excel’를 참조하면 엑셀 파일을 불러들여서 읽고 쓰기를 수행할 수 있다. 사용 방법은 프로젝트 생성 → Nuget 패키지 관리 → Microsoft.Office.Interop.Excel 선택 소스 코드 using System.IO; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; namespace CsharpUseExcel { public partial class Form1 : Form { public Form1() { InitializeComponent(); }