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

  • SEARCH
  • Home
  • 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 8374033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:49:53+00:00 2026-06-09T14:49:53+00:00

I have a very simple file transfer application (C# .NET) that allows users to

  • 0

I have a very simple file transfer application (C# .NET) that allows users to move files from one file location to another on the local filesystem or to move files to an SFTP location.

The file operations are defined by a simple XML file which identifies the source and destination of each copy activity and valid strings can be either local file paths C:\SomePath\SomeFile.txt, or by an SFTP URL sftp://somesite.com/somepath/somefile.txt.

The actual operations performed by the program differ greatly depending on the source and destination type. (Akin to how Windows explorer can take a path or URL).

My question is, apart from general string parsing or reg-ex matching, is there an efficient or built-in means to classify a given string as being a file path type (Drive letter, colon, backslash) and a URL (protocol, colon, double-slash, etc.)?

This question is similar to Distinguish a filename from an URL, but I’m looking for a .NET solution.

  • 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. Editorial Team
    Editorial Team
    2026-06-09T14:49:55+00:00Added an answer on June 9, 2026 at 2:49 pm
    if (new Uri(someString).IsFile)
    

    If the string is not a valid path or URI, you’ll get an exception.

    You can also check the Uri.Scheme property, which will return file, http, etc.

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

Sidebar

Related Questions

I have a very simple file upload that allows users to upload PDF files.
I have a very simple C++ file Multiplier.cpp with the corresponding header file, from
I have a very simple python script that should scan a text file, which
I have a map that reads an XML file; it's all very simple and
I have a very simple mod_wsgi python application that tries to write to a
I have a very simple web application that have to read and write in
I have a very simple XML file, that looks like this: <Data><Day Num=4197> <Date>270611</Date>
I have a very simple xml file that I would like to create a
I have a very very simple program that parses a csv file that has
I have a very simple batch file that lauches a Java app (Saxon) with

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.