开发者

write file in the same path as c# file

开发者 https://www.devze.com 2023-04-02 04:27 出处:网络
Is it possible to write file to th开发者_高级运维e same directory where the c# code that writes this file is ?

Is it possible to write file to th开发者_高级运维e same directory where the c# code that writes this file is ?

I mean something like there is c:\projects\myProject\test.cs

and when there is writeFile operation in test.cs

there is for example new file lest say test1.txt in c:\projects\myProject\test1.txt

I'm running asp.net application.


You're probably looking for Server.MapPath("~/Something.txt")


I think you can also try Application.StartupPath

0

精彩评论

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