0

Is it possible to write file to the 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.

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

1 Comment

Probably yes, what is the namespace of server class ? I cant fins it
0

I think you can also try Application.StartupPath

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.