C # Get full file path

I have an ASP FileUpload control and I load:

C:\Documents and Settings\abpa\Desktop\TTPublisher\apache-tomcat-6.0.26\webapps\ttpub\WEB-INF\classes\org\gtfs\tmp\GTFS_Rail\routes.txt

What is C # code to capture this entire string using the following code:

var pathOfCsvFile = Server.MapPath(ImportRoutes.FileName);
var adapter = new GenericParsing.GenericParserAdapter(pathOfCsvFile);
DataTable data = adapter.GetDataTable();

I know that Server.MapPath needs to be changed.

UPDATE:

Using System.IO.Path.GetFullPath, I gave the following result:

pathOfCsvFile = "C:\\Program Files\\Common Files\\Microsoft Shared\\DevServer\\10.0\\routes.txt"

+3
source share
2 answers

, , . , , , FileUploadControl ( HTML ) , . . , . , FileUploadControl: FileBytes FileContent.

, , - ( )? ?

+7

Server.MapPath . , Server.MapPath .

, , Server.MapPath.

0

Source: https://habr.com/ru/post/1761754/


All Articles