본문 바로가기

Web_Application/C#

(50)
[c#] selenium chrome driver scrollup/down 브라우저화면에 보이지 않는 영역의 element 를 찾기는 하나 클릭이벤트를 발생 시키지 못한다. 그래서 해당 element 가 나타나는 스크롤까지 임의로 스크롤을 이동시켜줘야한다. element의 위치 Location.x , y 를 가지고 스크롤 시켜줘도 되고 일정한 높이를 줘도 된다. up/down 은 javascript 를 실행하는 함수를 호출해서 스크립트로 제어한다. driver.Manage() 에는 스크롤 관련 함수가 없으며 window 위치와 크기를 제어하는 부분만 있다. public void ScrollUp(int x, int y) { IJavaScriptExecutor js = this.driver as IJavaScriptExecutor; Thread.Sleep(500); js.Execu..
[HtmlAgilityPack] SelectNodes Return : System.ArgumentNullException: 값은 null일 수 없습니다. 유발소스 var exampleImages = item.SelectNodes("//img[@width='43'][@height='17']").ToList(); if(exampleImages.Count() > 0) isExampleIncluded = true; else isExampleIncluded = false; System.ArgumentNullException: 값은 null일 수 없습니다. 매개 변수 이름: source 위치: System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 위치: ConsoleApplication.Program.RunMyApp(String[] args) 파일 {{소스}}:줄 123 수정소스 var exampleImages..
[c#] mssql spatial data 길이 취급 주의 geometry/geography varbinary(max) 가 한계 길이 STAsText() 로 Sql Management에서 취급하는 것은 한계가 있다. UnitTest 나 Console 프로그램에서 Binary로 전송 된 Data 들을 다시 Text로 변환 후 수정하고 다시 Binary 로 업데이트 한다. 주고 받는 형식은 sql 쪽은 Binary C# 쪽에서는 Bytes로 취급한다.
[c#] DLL 'SqlServerSpatial140.dll'을(를) 로드할 수 없습니다. 지정된 모듈을 찾을 수 없습니다. (예외가 발생한 HRESULT: 0x8007007E) An exception of type 'System.DllNotFoundException' occurred in Microsoft.SqlServer.Types.dll but was not handled in user code Additional information: DLL 'SqlServerSpatial140.dll'을(를) 로드할 수 없습니다. 지정된 모듈을 찾을 수 없습니다. (예외가 발생한 HRESULT: 0x8007007E) 참조https://goo.gl/WEKl7c https://goo.gl/7OewbA https://goo.gl/oYEqLt
[c#][mssql] Spatial Data type을 취급하기 위한 필수 패키지 C# 코딩에서 mssql Spatial Type을 취급하기 위한 필수 nuget 패키지 DotSpatial.Projections- 좌표계 변환 함수 포함 GeoJSON for Entity Framework 6 Spatial Data and WKT- Spatial m WKT 타입을 GeoJSON 으로 변경하는 함수 Microsoft.SqlServer.Types- Sql 서버의 타입 정의
Convert string format to Datetime string testDateString = "19900712"; DateTime testDatetime = DateTime.ParseExact(testDateString, "yyyyMMdd"); string resultDateString = string.Format("{0:yyyy년MM월dd일}", testDatetime); msdn : https://goo.gl/kLdZ9k
[다음 API] 주소 검색 샘플 다음 API 반환 구조 클래스 #region " [ 다음 주소검색 ] " public class DaumAddressSearchResult { public Channel channel { get; set; } } public class Channel { public string totalCount { get; set; } public string link { get; set; } public string result { get; set; } public string generator { get; set; } public string pageCount { get; set; } public string lastBuildDate { get; set; } public Item[] item { get; set; ..
[c#] 해당 경로에 파일 복사하기 string fileName = "{{복사 할 파일명}}"; string sourceFilePath = "{{원본 경로}}"; string targetFilePath = "{{복사 할 경로}}"; boolean existsCheck = false; boolean fileExists = false; FileInfo file; sourceFilePath = sourceFilePath + @"/" + fileName; file = new FileInfo(sourceFilePath); fileExists = file.Exists; if(fileExists) { try { if (!Directory.Exists(targetFilePath)) Directory.CreateDirectory(targetFilePath..