locked
Error in Could not find a part of the path RRS feed

  • Question

  • Dear All,

    i have created a folder in My project , but why i m not able to find a path, kindly advise, thank you

    Tuesday, April 15, 2014 12:54 PM

Answers

  • There wasn't a System folder in the original folder that you displayed, regardless, you don't set the properties on the folder itself, but on the individual files.  If you set the properties on the file to be copied, then the folder structure for it will get created.

    It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.

    • Marked as answer by Barry Wang Thursday, April 24, 2014 2:22 AM
    Wednesday, April 16, 2014 2:38 AM

All replies

  • use this code to get the correct path:

    iTextSharp.text.Image.GetInstance(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "/OUM/OUM.jpg");
    also, make sure the OUM folder is marked "Always Copy" so that you have the same available during runtime.

    hope this helps!


    Tuesday, April 15, 2014 1:04 PM
  • Dear All,

    after i tried the code, it show an below error.

    kindly advise, thank you

    {"Could not find a part of the path 'C:\\Users\\User-pc\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\System\\OUM\\OUM.jpg'."}

    Wednesday, April 16, 2014 1:59 AM
  • I would suggest just using: OUM/OUM.jpg and clicking on OUM.jpg in your solution explorer and ensure that the Build Action is set to None  and Copy to Output Directory is set to Copy if newer.

    There are methods to chase down the current working directory, but none will work if the file isn't being copied to the output directory.


    It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.

    Wednesday, April 16, 2014 2:18 AM
  • Dear all,


    thanks for reply, i found out that there is empty in folder properties . Am i miss out something ?

    Wednesday, April 16, 2014 2:32 AM
  • There wasn't a System folder in the original folder that you displayed, regardless, you don't set the properties on the folder itself, but on the individual files.  If you set the properties on the file to be copied, then the folder structure for it will get created.

    It would be greatly appreciated if you would mark any helpful entries as helpful and if the entry answers your question, please mark it with the Answer link.

    • Marked as answer by Barry Wang Thursday, April 24, 2014 2:22 AM
    Wednesday, April 16, 2014 2:38 AM