본문 바로가기

.NET/C#

(75)
c# 랜덤하게 숫자 생성 Random rnd = new Random(); int month = rnd.Next(1, 13);
WebBrowser Control에서 스크립트 에러 무시하기 webBrowser.ScriptErrorsSuppressed = true;
한자 등록시 ? 표시 해결하기 디비 스키마가 nvarchar가 아닌 varchar로 되어있을 경우 부득히가하게 스키마 변경이 불가능하다면 아래의 코드로 ?로 입력되는 문자를 unicode로 치환하면 된다. 우리 시스템이 그런 상황이라 한번 만들어 봤다. 아래의 메서드를 적용해 보길바란다. public string GetUnicodeString(string input) { Encoding encoding = Encoding.GetEncoding(51949);//중국어 간체 var bytest = encoding.GetBytes(input); var output = encoding.GetString(bytest); Console.WriteLine(input); Console.WriteLine(output); List unicodes = ..
Assembly Manipulation and C# / VB.NET Code Injection http://www.codeproject.com/Articles/20565/Assembly-Manipulation-and-C-VB-NET-Code-Injection 위에 기사에서 퍼온 글입니다. Assembly Manipulation and C# / VB.NET Code InjectionBy Sebastien LEBRETON, 26 Apr 2013 4.97 (151 votes) 1 2 3 4 54.97/5 - 151 votes8 removedμ 4.90, σa 1.12 [?] Download binaries - 1.3 MB Download source - 4.7 MB Latest ReleasesYou can always get the latest Reflexil releases here.Introduct..
BinaryFile 을 Hex로 표현하기 오늘 심심해서 이미지 바이너리 코드를 hex로 보고 싶었다 그래서 한번 코드를 작성해 봤다 using (BinaryReader reader = new BinaryReader(new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))) { byte line; int count = 1; int pos = 0; int length = (int)reader.BaseStream.Length; while (pos < length) { line = reader.ReadByte(); result += line.ToString("X").PadLeft(2,'0'); if (count % 16 == 0) { result += "\r"; } pos +=..
PublicKeyToken 정보보기 visual studio prompt에서 해당 dll이 있는 폴더로 이동하고 sn –T 어셈블리이름.dll을 실행한다.
Delegate 사용하기 http://www.codeproject.com/Articles/476946/WaysplusofplusDelegationplusinplus-NETplus-C-23plu위에서 퍼온 글입니다. 소개직접적으로 말하자면 delegation은 어떤 함수를 가리키는 프로세스이다. 그래서 delegate타입 변수가 함수의 pointer가 된다. 이 포스트에서는 나는 C#과 VB.NET에서 delegate를 어떻게 사용하는지에 초점을 맞추겠다. delegate를 사용하기 위한 간단한 4과정을 정의해보겠다. 일발적은 integer또는 string , float 과 같은 type과 비교해 보면 보다 간단하게 볼수 있을것입니다. integer와 string은 built-in 타입으로써 타입을 따로 선언할 필요가 없습니다. ..
4.5 Server 2003 오늘 서버 2003에 4.5를 설치하려고 했는데 이건 왠걸 2003에서는 설치가 안됩니다. 허컥 이런 아타까운 소식을 전해 드립니다. ^^;