CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: File Path in XML

    Quote Originally Posted by Arjay View Post
    In C++ yes, but not in C#.
    Even in C++ a great many coding standards dictate the use of all upper case for Preprocessor "constants" (ie #define), but the use of MixedCase for POD which is declare4d as "const".
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  2. #17
    Join Date
    Oct 2008
    Posts
    51

    Re: File Path in XML

    Quote Originally Posted by cjard View Post
    Use the Settings file! It's what it was invented for..

    http://msdn.microsoft.com/en-us/libr...69(VS.80).aspx
    Did cjard's answer solve your question shers?

  3. #18
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: File Path in XML

    i think so....because he did not asked again.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  4. #19
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: File Path in XML

    @TheCPUWizard: are you also agree that in C# it is not convention to have constants all upper case?
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  5. #20
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: File Path in XML

    Quote Originally Posted by toraj58 View Post
    @TheCPUWizard: are you also agree that in C# it is not convention to have constants all upper case?
    Yes. The ONLY place where all uppercase is the accepted convention in most environments is in preprocessor macros (typically used for conditional compilation).
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  6. #21
    Join Date
    Oct 2008
    Posts
    51

    Re: File Path in XML

    Agreed

  7. #22
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: File Path in XML

    yes, i also noticed that in MSDN microsoft has used camelCase for constants but it was more distinguishable for me to have it all uppercase and it does not conflict with any other convention; so i am confused!
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  8. #23
    Join Date
    Apr 2004
    Posts
    265

    Re: File Path in XML

    Quote Originally Posted by cjard View Post
    Use the Settings file! It's what it was invented for..

    http://msdn.microsoft.com/en-us/libr...69(VS.80).aspx

    Here is the code.

    Code:
    string path = Properties.Settings.Default.ParentPath;
                DirectoryInfo di =new DirectoryInfo(path);
    But it gives me error saying 'Illegal characters in path'.

    Thanks

  9. #24
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: File Path in XML

    what is the path you used....paste it here.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  10. #25
    Join Date
    Apr 2004
    Posts
    265

    Re: File Path in XML

    "C:\Test"

  11. #26
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: File Path in XML

    If this value is hardcoded, try "C:\\Test" or @"C:\Test".

  12. #27
    Join Date
    Apr 2004
    Posts
    265

    Re: File Path in XML

    When I wrote "C:\\Test" in the settings, the path returned in

    DirectoryInfo di =new DirectoryInfo(path);

    is "\"C:\\\\Test\" and when it's @"C:\Test", it returns "@\"C:\\Test\""

    The error is 'Illegal characters in path.'

    Thanks

  13. #28
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: File Path in XML

    where is setting?
    just test: "c:\test"
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  14. #29
    Join Date
    Apr 2004
    Posts
    265

    Re: File Path in XML

    Here it is!
    Attached Images Attached Images

  15. #30
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: File Path in XML

    remove the quotations around the c:\test
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

Page 2 of 3 FirstFirst 123 LastLast

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