본문 바로가기

.NET

(219)
NReco.VideoInfo 이용해서 동영상 실행 시간 가져오기 에러 동영상을 가져오려하는데 어떤 파일은 에러가 난다. 구글 검색해 보니 종속되는 ffprobe.exe 파일이 에러라고 한다 ffprobe만 다 시 받아서 실행 폴더 안에다 넣으니 잘된다 ㅎㅎ 혹시 삽질하시는 분들을 위해 남긴다.
c# 소수점 4자리 이하 버리기 소수점 4자리 이하 버리기 var avail = 1.002000009;var qty = Math.Truncate(avail * 100000) / 100000; 위와같이 하면 됩니다.
c# asp.net SHA256 256bit 암호화 // SHA256 256bit 암호화 public string SHA256Hash(string text, string salt, System.Security.Cryptography.HashAlgorithm hasher) { byte[] textWithSaltBytes = Encoding.UTF8.GetBytes(string.Concat(text, salt)); byte[] hashedBytes = hasher.ComputeHash(textWithSaltBytes); hasher.Clear(); return Convert.ToBase64String(hashedBytes); } public string GetPassword(string input) { return SHA256Hash(input, "salt값..
View에서 Controller에 프로퍼티 엑세스 view.cshtml에서 아래와 같이 controller를 엑세스할 수 있다. var baseController = this.ViewContext.Controller as Web.Controllers.BaseController;
HttpContext.User.Identity.IsAuthenticated false로 떨어질경우 폼인증을 제대로 설정했는지 한번 보자 혹시
잔디 알림 보내기 (Jandi send push) 아래의 소스 코드는 실제로 잔디 웹훅을 이용한 알림 전송에 대한예이다 try { string json = String.Format("{{\"body\" : \"[{0}]트랜스코딩이 완료 되었습니다.\",\"connectInfo\" : [{{\"title\" : \"[{0}]트랜스코딩완료\",\"description\" : \"[{0}]크랜스코딩이 완료되었습니다.{1}{2}\"}}]}}", result.title, Environment.NewLine, result.url); if (!String.IsNullOrEmpty(result.jandi_webhook)) { HttpWebRequest newRequest = WebRequest.Create(result.jandi_webhook) as HttpWebRe..
ASP.NET Identity 2.1 Custom Database(ASP.NET ID 2.1 사용자 지정 데이터베이스) 출처 : http://www.jamessturtevant.com/posts/ASPNET-Identity2.0-Custom-Database/ This is a two post series. You can read the second post at ASPNET Identity Custom Database and OWIN.I have to admit when I first took a deeper look at the ASP.NET’s Identity model in version 2.1 I was a bit overwhelmed. I was looking for a way to authenticate a user against an existing database using Forms authenticati..
.NET Core 2.0의 명령 프롬프트를 사용하여 첫 번째 .NET Core 콘솔 응용 프로그램 만들기 출처 : https://www.codeproject.com/Articles/1219943/First-NET-Core-Console-Application-using-Command-P 소개이 글에서는 .NET Core 에서 처음으로 콘솔 응용 프로그램을 만들겠습니다 . IDE 또는 Visual Studio를 사용하지 않고 .NET Core 기반 응용 프로그램을 빌드하는 방법을 살펴 보겠습니다 . 커맨드 라인을 사용하여 애플리케이션을 생성, 빌드 및 실행합니다. Visual Studio와 Visual Studio Code가 제공하는 멋진 기능을 모두 필요로하지 않는다면 메모장만으로 .NET Core 응용 프로그램을 만들 수 있습니다. 필요한 것은 컴퓨터에 .NET Core SDK가 설치되어 있어야합니다. Vi..