vb.net to c#

  • Thread starter Thread starter nasirmajor
  • Start date Start date
N

nasirmajor

Dear all, just a single line problem

this vb.net line works alright

fp = File.CreateText(Server.MapPath(".\UploadArabic\") & "test.txt")

but how to write it in c#?

following line is working alright

fp=File.CreateText(Server.MapPath("Rand2.txt"));

but not accepting (".\UploadArabic\")
 
Instead of this (".\UploadArabic\") change to (@".\UploadArabic\").
I mean, put @ symbol before the quotation. It should work.

Let us know if you have any issues in solving this.
 
Dear Myself
do it this way

fp = File.CreateText(Server.MapPath("UploadEng/react2.txt"));

you get worried to early.
try harder baby
regards
yourself
 
fp = File.CreateText(Server.MapPath(".\UploadArabic\") & "test.txt")

What about:
fp = File.CreateText(Server.MapPath(".\UploadArabic\") + "test.txt")

Or perhaps it doesn't like the backslashes?
fp = File.CreateText(Server.MapPath("\.\\UploadArabic\\") + "test.txt")
 
Thankyou all
i saw your answers bit late
however i did it with this
fp = File.CreateText(Server.MapPath("UploadEng/react2.txt"));
and it worked
thankyou all again
regard
nasir
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top