Page view counter

Specifying the location of a file that’s automatically generated

Last post 06-05-2007 11:01 AM by RichardLaw. 2 replies.

Sort Posts:

  • Specifying the location of a file that’s automatically generated

    06-04-2007, 7:26 AM
    • Loading...
    • RichardLaw
    • Joined on 10-20-2006, 4:49 AM
    • England, UK
    • Posts 307
    • Points 159

    Hi

    Thanks to other posts from this forum I’ve put together a script that generates a CSV file based on the content within a DataSource. Thing is, I’d like to give the user the option to specify the location of where the file will be generated – i.e., when they click ‘Make CSV’, they are prompted with a ‘SaveAs’ dialog box.

    The code I’m currently using for specifying the file location is:

    StreamWriter sw = new StreamWriter("c:/griddata.txt");Can someone please show me what I would need to add/change to provide a ‘SaveAs’ dialog box? I’m a beginner (in my eyes at least) so any examples would really be apreciated.

    Many thanks
    Richard

  • Re: Specifying the location of a file that’s automatically generated

    06-05-2007, 10:23 AM
    Answer

    RichardLaw:

    Hi

    Thanks to other posts from this forum I’ve put together a script that generates a CSV file based on the content within a DataSource. Thing is, I’d like to give the user the option to specify the location of where the file will be generated – i.e., when they click ‘Make CSV’, they are prompted with a ‘SaveAs’ dialog box.

    The code I’m currently using for specifying the file location is:

    StreamWriter sw = new StreamWriter("c:/griddata.txt");Can someone please show me what I would need to add/change to provide a ‘SaveAs’ dialog box? I’m a beginner (in my eyes at least) so any examples would really be apreciated.

    Many thanks
    Richard

    Hi RichardLaw,

    See the following article,

    http://west-wind.com/weblog/posts/76293.aspx (Downloading a File with a Save As Dialog in ASP.NET)

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Hope it helps,

    Hong Gang
    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Specifying the location of a file that’s automatically generated

    06-05-2007, 11:01 AM
    • Loading...
    • RichardLaw
    • Joined on 10-20-2006, 4:49 AM
    • England, UK
    • Posts 307
    • Points 159

    Perfect - thank you.

Page 1 of 1 (3 items)