C# - 다중 스레드에서 컨트롤을 변경 할 때

출처: MSDN // 델리게이트를 선언한다. delegate void SetTextCallback(string text); // 컨트롤의 접근은 따로 함수를 만들어서 접근하도록 한다. private void SetText(string text) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the...
더 읽기

C# - 문자열

지정 단어로 문자열 분해 string readLine = "A=B"; string[] word = readLine.Split(new Char[] { '=' }); 문자열 포맷 string CheatString = string.Format("@timeevent1:{0}", textBoxBlessing.Text); 지정된 단어를 문자열에서 (제일 처음 나오는)제거 하고 싶을 때 string str1 = "C:\ASDD"; string str2 = "C:\ASDD\Server.exe";...
더 읽기

C# - 파일 조작

클래스 단위로 파일에 쓰기 이 직렬화 방식은 꼭 .NET 플랫폼에서 서로 파일을 읽고 쓸 때만 사용 가능하다. 만약 .NET으로 만든 프로그램에서 아래와 같이 파일을 만들고 이것을 네이티브에서 읽으면 앞에 다른 값이 들어가 있다( 정확하게는 직렬화 되는 클래스의 메타 정보가 들어가...
더 읽기

C# - json 데이터 암호화, 복호화 하기

AESEncrypt로 암호화/복호화 하기 public static async Task<RESULT_T> RequestHttpAESEncry<REQUEST_T, RESULT_T>( string address, string reqAPI, string loginSeq, string userID, REQUEST_T reqPacket) where RESULT_T : new() { var resultData = new RESULT_T(); var api = "http://" + address + "/GameService/" + reqAPI; var...
더 읽기

코딩용 폰트

CodingFont - 자신에게 맞는 코딩 폰트를 찾는 게임 MonoLisa - 개발자를 위한 고정폭 폰트 (monolisa.dev) https://monolisa.dev/ 눈이 편하게 폭이 넓음 C와G, IL1, 0OØ 등에 확실한 차이를 둠 읽기 편한 선의 흐름 글자 흑백 공간의 조화 전혀 느낌이 다른 이탤릭체 Ligatures...
더 읽기

svn 에러 E155010 is scheduled for addition, but is missing

svn 업데이트를 하니 특정 디렉토리가 삭제가 되었는데 충돌이 나서 수동으로 지웠음. 이 후 커밋을 하려니 위와 같은 에러가 발생. 이런 경우 –force라는 플래그를 사용하여 강제적으로 없애준다. 위에 삭제된 디렉토리가 test1 이라고 하면 svn delete --force test1
더 읽기

golang - 랜덤 seed 설정하기

출처: https://qiita.com/makiuchi-d/items/9c4af327bc8502cdcdce 시간을 seed로 설정하기 time.Now().UnixNano()를 사용한다. package main import ( "fmt" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) fmt.Println(rand.Int63()) } 보안성이 높은 seed 사용하기 crypto/rand 패키지를 사용한다. package main import ( crand "crypto/rand" "fmt" "math" "math/big" "math/rand" ) func...
더 읽기

C# - 예외 출력 helper 클래스

출처: https://teratail.com/questions/24669 public static class ExceptionHelper { public static string ExtractException(this Exception ex, int indent = 2) { var indentStr = new String(' ',indent); StringBuilder traceLog = new StringBuilder(); StackTrace trace = new StackTrace(ex, true); foreach (var frame in trace.GetFrames())...
더 읽기

C++ - Delegate 라이브러리

상호 참조를 할 경우, 상호 참조 되는 클래스 중 둘 중 하나가 변경될 경우 상호 컴파일이 일어난다 -> 작은 프로젝트라면 모르겠지만 대규모 프로젝트에서는 작은 소스 수정 하나가 큰 짐이 될 수 있다 그리고 설계 상 상호 참조를 하고 있다는 것은...
더 읽기

C# - C++과 연동

꼭 봐야 될 것 http://sj21.wo.to/tt/483 http://sj21.wo.to/tt/484 http://blogs.msdn.com/junfeng/archive/2006/05/20/599434.aspx How to: Marshal Structures Using C++ Interop How to: Marshal Embedded Pointers Using C++ Interop C++ #include <msclr\marshal.h> using namespace System; using namespace msclr::interop; int main(int argc, char** argv) { const char* x...
더 읽기