분류 전체보기
-
[Database] Linux-Docker-Mysql 데이터베이스 자동 백업Database 2021. 11. 29. 15:31
backup/database에 주기적으로 백업 데이터를 저장하는 방법 입니다. 해당 글은 백업 스크립트는 backup 폴더에 생성하는 것을 기준으로 하고 있습니다. 1. 폴더를 생성합니다. (스크립트 보관 및 백업데이터 보관용) # 경로 생성 mkdir /backup mkdir /backup/database 2. 스크립트 생성 # 스크립트를 생성합니다. vi /backup/backup_db.sh # 생성 후 i를 눌러 데이터를 입력합시다. (아래 코드(2.1) 붙여 넣기(마우스 우클릭)) # 입력 후에 ESC를 누르고 :wq를 입력하고 빠져나옵니다. 2.1 #!/bin/sh echo "============= 20일 지난 데이터 삭제 시작 =============" # 20일이 지난건 지워버림 DEL_F..
-
[WPF] hexColor to (Color or SolidColorBrush)Microsoft .NET/WPF 2021. 11. 24. 10:46
// Color Color color_1 = (Color)new BrushConverter().ConvertFrom("#CA5100"); //SolidColorBrush SolidColorBrush brush_1 = (SolidColorBrush)new BrushConverter().ConvertFrom("#CA5100"); //xamarin Xamarin.Essentials.ColorConverters.FromHex("#CA5100")
-
[C#] string 타입 형식지정Microsoft .NET/C# 2021. 10. 15. 14:31
public class Member { public string Id { get; set; } // 암호 형식 지정 [DataType(DataType.Password)] public string Pw { get; set; } // 이메일 형식 지정 [DataType(DataType.EmailAddress)] public string Email { get; set; } // 날짜 형식 지정 [DataType(DataType.Date)] public DateTime Birthday { get; set; } // Custom - 사용자 지정 데이터 유형을 나타냅니다. // DateTime - 시간의 순간을 나타내며, 날짜와 시간으로 표현됩니다. // Date - 날짜 값을 나타냅니다. // Time - 시간 ..
-
[ASP.Net Core] (작성중) 리눅스(centOS) Docker 에 ASP.Net Core 배포Microsoft .NET/ASP.Net & ASP.Net Core 2021. 8. 18. 18:44
1. 환경 설치 리눅스(centOS)에 Docker 설치 - https://docs.docker.com/engine/install/centos/ 리눅스(centOS)에 ASP.Net Core 설치 - https://docs.microsoft.com/ko-kr/dotnet/core/install/linux-centos 2. 로그인 및 배포파일 경로로 이동 ex) cd /[폴더경로1]/[폴더경로2].............. 3.1 스크립트 제작으로 일괄 진행 ① 스크립트 파일 생성 : vi [스크립트 파일명].sh ex) vi sample.sh ② 스크립트 내용 작성 (작성 후 esc -> :wq 입력) #!/bin/bash #기존 서비스 정지 docker stop online-api #기존 서비스 제거 d..
-
[ASP.Net Core] 접속자 IP 받기Microsoft .NET/ASP.Net & ASP.Net Core 2021. 7. 16. 14:35
"Startup.cs" 클래스의 "ConfigureServices 함수"에 아래 코드 추가 public void ConfigureServices(IServiceCollection services) { #region IP services.AddSingleton(); #endregion services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); } IP를 받을 Controller에 아래 코드를 추가하고 생성자 명을 본인 코드에 맞게 변경합니다. /// /// 생성자 /// /// public UserController(Microsoft.AspNetCore.Http.IHttpContextAccessor _acc) { HttpCont..
-
[C#] Thread, Thread 인자 전달, BeginInvoke, Invoke 복붙용Microsoft .NET/C# 2021. 3. 17. 11:05
Thread Thread th = new Thread(new ThreadStart(functionSample)); th.Start(); private void functionSample() { } Thread 인자 전달 // Type - 1 Thread th = new Thread(() => functionSample("전자기린", 29)); th.Start(); private void functionSample(string name, int age) { } // Type - 2 Thread th = new Thread(new ParameterizedThreadStart(functionSample)); th.Start("전자기린"); private void functionSample(object _nam..
-
[ASP.Net Core API] File Upload API / 파일 업로드 APIMicrosoft .NET/ASP.Net & ASP.Net Core 2021. 2. 3. 11:23
파일 저장 경로, 저장 파일 명, 파일을 필수값으로 받아서 서버에 저장하는 API API that receives file storage path, save file name, and file as required values and saves them to the server #region Upload /// /// 파일 업로드 /// /// 파일 저장 경로(서버) /// 파일 저장 이름(서버) /// 파일(클라이언트) /// //[EnableCors("CORS")] [HttpPost("upload")] public string Upload( [Required][FromForm(Name = "path")]string path, [Required][FromForm(Name = "filename")]str..