Category Archives: C#

Math.Pow(밑, 지수)

C#에서 Math.Pow는 거듭제곱(제곱 연산) 을 하는 함수입니다.

65600 / 100 = 656.00 반환형은 double 그래서 decimal 계산할 때는 반드시 캐스팅 필요: 🔬 내부 동작 원리 Math.Pow(10, 3) 은 내부적으로

을 계산해서 1000 반환 하지만 double 기반 계산이라

같은 미세 오차가 있을 수 있습니다. Sample

Category: C#

c# 프로젝트 참조들이 느낌표로 표시

Overview : 원인과 해결 소스를 받고 소스를 열어 보면 위와 같이 참조가 모드 느낌표로 나온다. 원인 : dll 위치가 컴 마다 다르기 때문 해결 : 오류가 나더라도, 컴파일 하면 소스에서 가까운 위치에서 Dll 을 찾기 하여 하나씩 풀린다. – 풀리지 않는 DLL 은 프로그램을 닫고 다시 열면 찾아진다ㅏ. 마지막으로 찾지 못하는 DLL 은 수동으로 찾아준다.

Category: C#

ASMX 웹 서비스에서 파라미터 처리 방식

1. 모든 파라미터를 전송하지 않아도 에러가 발생하지 않도록 설정하는 방법 ✅ 방법 1: Nullable 타입 사용 파라미터를 nullable (int?, double?, DateTime?, string 등)로 설정하면, 클라이언트가 값을 보내지 않아도 에러 없이 처리됩니다. 위 예제에서: ✅ 방법 2: SOAP 헤더 또는 JSON 바인딩 활용 만약 REST API와 유사하게 일부 데이터만 선택적으로 보내고 싶다면, JSON을 활용하는 것이 좋습니다.… Read More »

Category: C#

Scintilla

Remark : Scintilla 오픈 소스 Net에서 사용하기 1.Nuget에서 패키지 다운로드 2.Net Demo 다운로드 3.Net Demo 실행화면

Category: C#

string.Format(“{0:s}.{0:fff}

Standard DateTime Formatting In DateTimeForma­tInfo there are defined standard patterns for the current culture. For example property ShortTimePattern is string that contains value h:mm tt for en-US culture and value HH:mm for de-DE culture. Following table shows patterns defined in DateTimeForma­tInfo and their values for en-US culture. First column contains format specifiers… Read More »

Category: C#

c# 연결 리스트 정렬하기

Category: C#

C# ToUniversalTime 으로 사용하기

추천 : ToUniversalTime

결과 참조 : https://stackoverflow.com/questions/1201378/how-does-datetime-touniversaltime-work

Category: C#

C# MySqlConnection

NuGet – MySqlConnector 설치 방법1. 포트연결은 : 아니고 , Insert 방법2. Asp.net Web.config Core 참조 : https://mysqlconnector.net/tutorials/connect-to-mysql/ Error : 원인 : MysqlBench 에서 나오는 쿼리에서 ‘(싱글쿼테이션)을 다 빼야지 된다. / C# 하고 java 의 문법적 차이

Category: C#

특수문자 제거

다음과 같은 작업이 편해짐 //sFileName = sFileName.Replace(” “, “”).Trim(); //sFileName = sFileName.Replace(@”\”, “”).Trim(); //sFileName = sFileName.Replace(“/”, “”).Trim(); //sFileName = sFileName.Replace(“:”, “”).Trim(); //sFileName = sFileName.Replace(“?”, “”).Trim(); ////sFileName = sFileName.Replace(“””, “”).Trim(); //sFileName = sFileName.Replace(““, “”).Trim(); //sFileName = sFileName.Replace(“|”, “”).Trim(); 결과

Category: C#