Quantcast
Channel: 203luv – Sam Lee's .NET Blog
Browsing latest articles
Browse All 28 View Live

Image may be NSFW.
Clik here to view.

Windows Service – how to debug on console mode

1. Create you new Windows Service project in Visual Studio 2. Modify Program.cs file as follow: static class Program { static void Main(string[] args) { if (args.Length == 0) // if there is no...

View Article



Image may be NSFW.
Clik here to view.

How to format XML string?

simply go to bing.com in the search box, type XML Formatter and hit enter. You will see bing’s built-in XMl formatter. Same for Json formatter.    

View Article

Image may be NSFW.
Clik here to view.

robots.txt disallow all

create empty robots.txt file. type below and save User-agent: * Disallow: / 3. save into the root directory of the application. 4. for .NET application, be sure your route rule allows to access/open...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET Web API – how to retrieve the access token?

The default url to retrieve the access token is /token. where you need to post username, password, and grant_type. I created a simple web form on Home-index page for the web api testers to retrieve the...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET Web API – how to change the token expiration time?

go to ~/App_Start/Startup.Auth.cs find this line and update the timespan : OAuthOptions = new OAuthAuthorizationServerOptions { TokenEndpointPath = new PathString("/Token"), Provider = new...

View Article


Image may be NSFW.
Clik here to view.

Web APi + Swagger How to set token in request header

Swagger with Web API does not send the bearer access token in the request header. In order to make this work we need to do some customization. Under Scripts(or any) folder, create swagger-api-auth.js...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET Web API Forgotpassword function

Unlike ASP.NET MVC application, Web API’s AccountController does not include the ForgotPassword funtion by default. However, they both function in same way. Create ForgotPassword method in...

View Article

Image may be NSFW.
Clik here to view.

The model backing the ‘ApplicationDbContext’ context has changed since the...

solution delte : _MigrationHistory table.

View Article


Image may be NSFW.
Clik here to view.

Web API : List to csv file download

StringHelper.cs public static string CreateCSVTextFile<T>(List<T> data) { var properties = typeof(T).GetProperties(); var result = new StringBuilder(); var header = properties.Select(x...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET CSV download 한글깨짐현상

public ActionResult Download() { var data = Encoding.UTF8.GetBytes("some data"); var result = Encoding.UTF8.GetPreamble().Concat(data).ToArray(); return File(result, "application/csv", "foo.csv"); }...

View Article
Browsing latest articles
Browse All 28 View Live




Latest Images