locked
Read .txt file RRS feed

  • Question

  • Hello,

    I want to read a txt file in My Documents\a1\a2\stock.txt in the smart device.

    File exists in the folder but I've get the error:File not exists in the path.

    What can I do,thanks.

    Friday, October 4, 2013 1:04 PM

All replies

  • That likely means file is not really at that location even though you think it is.

    Common reasons:

    1. File is actually on the desktop, not on the device.

    2. File is not in that folder but in some other folder.

    3. File path is incorrect, e.g. does not start from the root folder "\", is relative or has a driver letter.

    You could use file explorer on the device to verify file indeed exists and is on the right spot.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, October 4, 2013 5:27 PM
  • I think file path is incorrect because I get error:Could not find a part of the path.

    string fName = Environment.GetFolderPath(Environment.SpecialFolder.Programs);

    fName =fName + @"\aa\bb\cc\stock.txt";

    The file directory is aa\bb\cc already available in device.

    I don't know what to do.

    Thank you.

    Saturday, October 5, 2013 7:43 AM
  • You should start file explorer on your device and navigate to whatever folder fName variable has after special folder was appended.  


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Saturday, October 5, 2013 5:54 PM
  • I can't read storage card files in openfiledialog.



    gldn

    Monday, October 7, 2013 12:40 PM