Click here to Skip to main content
15,921,941 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
In my work scenario,I have to transfer data dynamically to a text file and it should be save on D drive of hard disk. I'm using following code

C#
System.IO.File.AppendAllText(@"D:\" + "p" + ds1.Tables["URN"].Rows[c]["URN"].ToString() + ".txt", str.ToString());


The problem is it is working on developing phase but when I upload application into the webserver it's not working I mean the data is not saving on D drive.

Can anyone suggeste me regrading this one?
Posted
Comments
Sergey Alexandrovich Kryukov 31-Jan-12 19:11pm    
What notepad? This is a desktop application which comes with Windows. What drive D? You have no idea what you are asking about.
--SA
GC Theja 31-Jan-12 23:12pm    
can u check the question properly
GC Theja 31-Jan-12 23:18pm    
Thanks for your reply.
In my question, I've clearly mentioned that I'm getting problem when I upload the application in webserver. So, it is web application. not windows one. I think we can't upload windows application into webserver. and also I've clearly mentioned in my question that I want to save the text file(.txt) in D drive of the hard disk. this hard disk is in server system. I think you may aware of hard disks and drives...

1 solution

i thinks you don't permissions to save data on D drive use server.mappath to map virtual location to actual location.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Jan-12 19:15pm    
It was an idiotic vote of 2. OP has no clue anyway. I counter-voted with my 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900