Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 126483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:19:30+00:00 2026-05-11T05:19:30+00:00

I have a problem with the .NET’s Uri implementation. It seems that if the

  • 0

I have a problem with the .NET’s Uri implementation. It seems that if the scheme is ‘ftp’, the query part is not parsed as a Query, but as a part of the path instead.

Take the following code for example:

Uri testuri = new Uri('ftp://user:pass@localhost/?passive=true'); Console.WriteLine(testuri.Query); // Outputs an empty string Console.WriteLine(testuri.AbsolutePath); // Outputs '/%3Fpassive=true' 

It seems to me that the Uri class wrongfully parses the query part as a part of the path. However changing the scheme to http, the result is as expected:

Uri testuri = new Uri('http://user:pass@localhost/?passive=true'); Console.WriteLine(testuri.Query); // Outputs '?passive=true' Console.WriteLine(testuri.AbsolutePath); // Outputs '/' 

Does anyone have a solution to this, or know of an alternative Uri class that works as expected?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:19:30+00:00Added an answer on May 11, 2026 at 5:19 am

    Well, the problem is not that I am unable to create a FTP connection, but that URI’s are not parsed accoding to RFC 2396.

    What I actually intended to do was to create a Factory that provides implementations of a generic File transfer interface (containing get and put methods), based on a given connection URI. The URI defines the protocol, user info, host and path, and any properties needed to be passed should be passed through the Query part of the URI (such as the Passive mode option for the FTP connection).

    However this proved difficult using the .NET Uri implementation, because it seems to parse the Query part of URI’s differently based on the schema.

    So I was hoping that someone knew a workaround to this, or of an alternative to the seemingly broken .NET Uri implementation. Would be nice to know before spending hours implementing my own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 161k
  • Answers 161k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming: <ul class="menu"> <li><a href="#">item-1</a> <li><a href="#">item-2</a> </ul> Just do:… May 12, 2026 at 11:53 am
  • Editorial Team
    Editorial Team added an answer The finalizer is necessary as a fallback mechanism to eventually… May 12, 2026 at 11:53 am
  • Editorial Team
    Editorial Team added an answer Control c = LoadControl("~/Sample.ascx"); form1.Controls.Add(c); EDIT: Registered user control's class… May 12, 2026 at 11:53 am

Related Questions

I have a problem with the .NET's Uri implementation. It seems that if the
I'm trying to setup CruiseControl.net at the moment. So far it works nice, but
I have a graph component in Flex and my end-user wants to be able
I'm having a problem designing part of my program (not writing it, for once!).
Alright I've spent a good three days trying this, here's the scenario: I want

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.