Server.MapPath(“.”), Server.MapPath(“~”), Server.MapPath(@””), Server.MapPath(“/”). What is the difference?
Can anyone explain the difference between Server.MapPath("."), Server.MapPath("~"), Server.MapPath(@"") and Server.MapPath("/")?
Can anyone explain the difference between Server.MapPath("."), Server.MapPath("~"), Server.MapPath(@"") and Server.MapPath("/")?
I use a FileUploader control in my application. I want to save a file to a specified folder. If this folder does not exist, I want to first create it, and then save my file to this folder. If the folder already exists, then just save the file in it.
So I have a web project, and I’m trying to get the root directory of the website using the c# method Directory.GetCurrentDirectory(). I don’t want to be using a static path as the file locations will be changing in the future. This method is running in my imageProcess.aspx.cs file, but where I thought it would return:
I have a line of code checking if a directory exists and then getting the list of files in it.
I have an application with 2 directories (books and export).
If we create a book or a page of a book in the application a directory is added with the id of the page (this is for uploading resources).
If we delete a page, the page (and it’s directory) is removed from the database and the filesystem.
Is there any way to upload entire folder (a folder) in asp.net?
I inherited a website and see that folder in the web root. I’m trying to clean out the old crap, and wondering if I can delete it.
Are they equivalent or alternatives to each other? Is any of them deprecated and if so, which one? Which one is recommended for use in an ASP.NET web application? My aim is to extract all files from a specific directory recursively.
I have a directory ‘Folder’ with many subdirectories inside this directory. Inside every subdirectory there are many images. I want to loop through subdirectories in the ‘Folder’ directory, then loop through all images in every directory to export the images out to Excel, with images from each subdirectory in one Excel worksheet.