CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    1

    IsolatedStorageFileStream Enquiry

    Hey all, I got a question in relation to the IsolatedStorageFileStream.... I was wondering how I capture the path of the document after my textbox displays the document name.

    OpenFileDialog dlg = new
    OpenFileDialog();
    dlg.Filter = @"Picture File (*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp
    | All Files (*.*)|*.*"
    ;
    if
    (dlg.ShowDialog() == true
    )
    {
    txtFileUpload.Text = dlg.SafeFileName;
    }



    For example : I am able to do this using

    FileStream (txtFileUpload.Text, FileMode.Open, FileAccess.Read);


    But with IsolatedStorageFileStream, it would display FileNotFoundException.

    So I was wondering, is there a way of which I could write IsolatedStorageFileStream much like the FileStream displayed above??

    I am learning the C# language and I hope I could learn this as most of the examples that I have seen online have hardcoded the path like "MyFile.txt", which I do not wish for that.

    Are there any tutorials or references of which I could refer in regards to IsolatedStorage?

    Thank you for your time.

  2. #2
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: IsolatedStorageFileStream Enquiry

    Off the top of my head...

    Are you specifying an absolute path to your file? This would cause the failure.

    IsolatedStorage uses it's own 'area' of the file system to store data. All of the path's it uses are relative to that.
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured