Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get file path in .net core from wwwroot folder

public class HomeController : Controller {
    private IWebHostEnvironment _hostEnvironment;

    public HomeController(IWebHostEnvironment environment) {
        _hostEnvironment = environment;
    }

    [HttpGet]
    public IActionResult Get() {
        string path = Path.Combine(_hostEnvironment.WebRootPath, "Sample.PNG");
        return View();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# get list item in random order 
Csharp :: asp.net core api Self referencing loop detected for property 
Csharp :: unity sort a list 
Csharp :: c# linq select as new object 
Csharp :: c# create array with n elements 
Csharp :: linq query get last day of month 
Csharp :: c# get process file location 
Csharp :: c# mongodb get all documents 
Csharp :: power of number 
Csharp :: unity rotate around axis 
Csharp :: linq when name then orderby 
Csharp :: linq query select where c# 
Csharp :: index of c# 
Csharp :: how to skip bin/Debug/netcoreapp3.1/ on the reltaive path 
Csharp :: Hello World Dotnet 
Csharp :: To CharArray 
Csharp :: c# max two values 
Csharp :: meaning immutable and mutable 
Csharp :: adding a dependency injection service in windows forms app 
Csharp :: linked list revrse 
Csharp :: unity switch to scene and transfer data 
Csharp :: element click intercepted exception in selenium C# 
Csharp :: singleton design pattern c# volatile 
Csharp :: compare two strings in c# 
Csharp :: unity agent look at 
Csharp :: c# callback action lambda 
Csharp :: fluent api 
Csharp :: c# make a automapper 
Csharp :: label wpf 
Csharp :: reverse a linked list C# 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =