开发者

Access file in App_Data

开发者 https://www.devze.com 2023-04-09 00:35 出处:网络
I have stored a file HelloWorld.txt in App_Data. My applicatio开发者_如何转开发n is running locally but not on Server.

I have stored a file HelloWorld.txt in App_Data.

My applicatio开发者_如何转开发n is running locally but not on Server.

File Path is D:\MyProject\App_Data\HelloWorld.txt

How can I access?

Is this is the way?

var file= File.ReadAllText(@"D:\MyProject\App_Data\HelloWorld.txt"); 

(File is on my disk but not on server)

or is there any other way?

I cannot use server.Mappath(); because my file is not on server.

0

精彩评论

暂无评论...
验证码 换一张
取 消