URI Possible Bug?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark_overstreet@compuserve.com

    URI Possible Bug?

    The following code appears to be a bug. Can anyone confirm?


    Uri newURI = new
    Uri("file:///C:/Projects/Labor/Helpdesk/Source/C#/Labor.Helpdesk. Website.Solutio n/Labor.Helpdesk. Website/bin/Labor.Helpdesk. DataLayer.DLL") ;

    Console.Writeli ne(newURI.Local Path);

    Output:

    C:\Projects\Lab or\Helpdesk\Sou rce\C

    This does not return the entire path as expected or am I missing
    something?

    Thanks
    Mark

  • Dustin Campbell

    #2
    Re: URI Possible Bug?

    The following code appears to be a bug. Can anyone confirm?
    >
    Uri newURI = new
    Uri("file:///C:/Projects/Labor/Helpdesk/Source/C#/Labor.Helpdesk. Websi
    te.Solution/Labor.Helpdesk. Website/bin/Labor.Helpdesk. DataLayer.DLL") ;
    Console.Writeli ne(newURI.Local Path);
    >
    Output:
    >
    C:\Projects\Lab or\Helpdesk\Sou rce\C
    >
    This does not return the entire path as expected or am I missing
    something?
    pound symbols (#) have special meaning in URIs. They are used to delmit a
    fragment identifier in a URI reference. See RFC 2396 at http://tools.ietf.org/html/rfc2396
    for details. Escaping the # character works fine:

    Uri newURI = new
    Uri("file:///C:/Projects/Labor/Helpdesk/Source/C%23/Labor.Helpdesk. Website.Solutio n/Labor.Helpdesk. Website/bin/Labor.Helpdesk. DataLayer.DLL") ;

    Console.Writeli ne(newURI.Local Path);


    Best Regards,
    Dustin Campbell
    Developer Express Inc.


    Comment

    • mark_overstreet@compuserve.com

      #3
      Re: URI Possible Bug?

      Thanks. One more thing. The path I am getting is not hardcoded but
      from a built in class as follows and is not escaped. How can I escape
      it?

      System.Reflecti on.Assembly.Get ExecutingAssemb ly().Location



      On Nov 7, 12:50 pm, Dustin Campbell
      <dust...@no-spam-pleasedevexpres s.comwrote:
      The following code appears to be a bug. Can anyone confirm?
      >
      Uri newURI = new
      Uri("file:///C:/Projects/Labor/Helpdesk/Source/C#/Labor.Helpdesk. Websi
      te.Solution/Labor.Helpdesk. Website/bin/Labor.Helpdesk. DataLayer.DLL") ;
      Console.Writeli ne(newURI.Local Path);
      >
      Output:
      >
      C:\Projects\Lab or\Helpdesk\Sou rce\C
      >
      This does not return the entire path as expected or am I missing
      something?pound symbols (#) have special meaning in URIs. They are usedto delmit a
      fragment identifier in a URI reference. See RFC 2396 athttp://tools.ietf.org/html/rfc2396
      for details. Escaping the # character works fine:
      >
      Uri newURI = new
      Uri("file:///C:/Projects/Labor/Helpdesk/Source/C%23/Labor.Helpdesk. Website.­Soluti on/Labor.Helpdesk. Website/bin/Labor.Helpdesk. DataLayer.DLL") ;
      >
      Console.Writeli ne(newURI.Local Path);

      Best Regards,
      Dustin Campbell
      Developer Express Inc.

      Comment

      • Ben Voigt

        #4
        Re: URI Possible Bug?

        >
        ><mark_overstre et@compuserve.c omwrote in message
        >news:116292378 4.903916.31620@ h48g2000cwc.goo glegroups.com.. .
        >Thanks. One more thing. The path I am getting is not hardcoded but
        >from a built in class as follows and is not escaped. How can I escape
        >it?
        Uri.EscapeUriSt ring, but better would be to use UriBuilder



        Comment

        Working...