c# - Creating a text file on click of a button -



c# - Creating a text file on click of a button -

i want create text file have contents fetched 1 of tables in database. contents should display follows:-

item1 id1 item2 id2 item3 id3 item4 id4 item5 id5

i want contents this. names of items , ids diff ofcourse way of them appearing in th etext file should this.

how go this? please give me ideas. tried create file using next code:-

using (var sw = new streamwriter(file.open(@"d:\myfile.txt", filemode.createnew), encoding.getencoding("iso-8859-1"))) { sw.writeline("my text..."); }

and got created fine. but, when tried create file in c: drive, said access path denied. want create map file in helicon installed in c: 1 time file has been created, 1 time again when click "create file" button in c# code, should either delete file , create 1 time again or overwrite contents fresh info items table. should do? please help me! new this. how create work ?

i had same problem , due windows 7 blocking me placed in project folder wasn't problem @ ,hope helps.

c# asp.net

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -