Results 1 to 2 of 2

Thread: Using GenericUriParserOptions in a Net Compact Framework 3.5 project

  1. #1
    .NET Framework
    .NET 3.0 (VS 2005/2008)
    Join Date
    May 2008

    Using GenericUriParserOptions in a Net Compact Framework 3.5 project

    Hi. I have a handheld terminal on Windows CE6.0 Net CF3.5, and need to send urls to a web server without letting it include the (buggy) extra backslash you get when you convert the url to %5C and %2F etc. (encode all the parameters using the RFC 3986 standard).

    To this end I need to use GenericUriParserOptions, specifically DontUnescapePathDotsAndSlashes. I've been onto a few MS pages

    where it says:

    <FlagsAttribute> _
    Public Enumeration GenericUriParserOptions
    Dim instance As GenericUriParserOptions
    The 'Dim instance As GenericUriParserOptions' is OK but the declaration doesn't make any sense to me or to the compiler. I'm expecting a function that does something like this:

    Dim request As System.Net.HttpWebRequest = WebRequest.Create("http://" & DontUnescapePathDotsAndSlashes(myURL))
    but I don't understand the declaration bit or how to actually prevent the stray backslashes in the url after encoding the parameters.

    Thank you for your help.

  2. #2
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Sydney, Australia
    You should do some general reading on enumerations and how to use them. Your code example is treating it like it's a method, which it's not. It's a value, so you pass it to a method as an argument. If you've read that page you linked to then you'd read this:
    You can combine any of these options to configure a generic URI parser by passing the options as a parameter to the System.GenericUriParser constructor.
    So, you create a GenericUriParser object and pass the value GenericUriParserOptions.DontUnescapePathDotsAndSla shes to the constructor.

Tags for this Thread


Posting Permissions

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