tagged [uri]

How can I get the baseurl of site?

How can I get the baseurl of site? I want to write a little helper method which returns the base URL of the site. This is what I came up with: ``` public static string GetSiteUrl() { string url = st...

27 Sep at 06:54

An URL to a Windows shared folder

An URL to a Windows shared folder Is there a way to incorporate a link to a Windows shared folder into an HTML page? E.g. a link to `\\server\folder\path`? For simplicity, let's say the page will be o...

8 Aug at 07:9

Invalid URI: The format of the URI could not be determined

Invalid URI: The format of the URI could not be determined I keep getting this error. > Invalid URI: The format of the URI could not be determined. the code I have is: the content in slct.Text is `ftp...

16 Jun at 21:25

How to extract file name from an Uri in C#?

How to extract file name from an Uri in C#? > [Get file name from URI string in C#](https://stackoverflow.com/questions/1105593/get-file-name-from-uri-string-in-c-sharp) How to extract file name fro...

23 May at 12:0

Drawing an image from a data URL to a canvas

Drawing an image from a data URL to a canvas How can i open an image in a Canvas ? which is encoded I am using the The output is the encoded base 64 image. How can i draw this image on a canvas? I wan...

24 Jan at 03:38

C#, Is there a better way to verify URL formatting than IsWellFormedUriString?

C#, Is there a better way to verify URL formatting than IsWellFormedUriString? Using: Doesn't catch everything. If I type `htttp://www.google.com` and run that filter, it passes. Then I get a `NotSup...

12 Apr at 00:47

Convert file path to a file URI?

Convert file path to a file URI? Does the .NET Framework have any methods for converting a path (e.g. `"C:\whatever.txt"`) into a file URI (e.g. `"file:///C:/whatever.txt"`)? The [System.Uri](https://...

30 Mar at 20:49

What is Uri Pack, and ":,,," in a BitmapImage?

What is Uri Pack, and ":,,," in a BitmapImage? What I add a Image.Source I have to type the following: I'm moving from web development to WPF C# and I don't get why setting a Path has extra stuff in i...

22 Mar at 11:45

Replace host in Uri

Replace host in Uri What is the nicest way of replacing the host-part of an Uri using .NET? I.e.: ``` string ReplaceHost(string original, string newHostName); //... string s = ReplaceHost("http://oldh...

26 Oct at 21:52

Parse a URI String into Name-Value Collection

Parse a URI String into Name-Value Collection I've got the URI like this: I need a collection with parsed elements: ``` NAME VALUE ------------------------ client_id SS response_type code...

8 Dec at 11:54

Method to determine if path string is local or remote machine

Method to determine if path string is local or remote machine What's the best way, using C# or other .NET language, to determine if a file path string is on the local machine or a remote server? It's ...

9 Dec at 22:26

How to implement my very own URI scheme on Android

How to implement my very own URI scheme on Android Say I want to define that an URI such as: must be handled by my own application, or service. Notice that the scheme is `"myapp"` and not `"http"`, or...

.NET - Get protocol, host, and port

.NET - Get protocol, host, and port Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: `http://www.mywebsite.com:80/pages/page...

19 Jul at 08:57

System.Uri and encoded colon (:)

System.Uri and encoded colon (:) Before .Net 4.5, it seems that System.Uri would unencode encoded slashes, but this has since been fixed. Reference: [https://stackoverflow.com/a/20733619/188740](https...

23 May at 12:2

Get individual query parameters from Uri

Get individual query parameters from Uri I have a uri string like: [http://example.com/file?a=1&b=2&c=string%20param](http://example.com/file?a=1&b=2&c=string%20param) Is there an existing function th...

21 May at 18:25

Changing the scheme of System.Uri

Changing the scheme of System.Uri I'm looking for canonical way of changing scheme of a given [System.Uri](http://msdn.microsoft.com/en-us/library/system.uri.aspx) instance with [System.UriBuilder](ht...

31 Jul at 10:54

OData DateTime filter Edm.String error?

OData DateTime filter Edm.String error? I am writing an DateTime filter query in OData like this: and met the following error: ![enter image description here](https://i.stack.imgur.com/DIdMx.png) I di...

23 May at 12:17

Add scheme to URL if needed

Add scheme to URL if needed To create a Uri from a string you can do this: But the problem is if the string (like the one above) doesn't contain the protocol you will get an exception: "`Invalid URI: ...

11 Oct at 14:34

How to write an URI string in App.Config

How to write an URI string in App.Config I am making a `Windows Service`. The `Service` has to donwload something every night, and therefor I want to place the URI in the App.Config in case I later ne...

c# type to handle relative and absolute URI's and local file paths

c# type to handle relative and absolute URI's and local file paths I have a use cases where I will be dealing with both local file paths (e.g. `c:\foo\bar.txt`) and URI's (e.g. `http://somehost.com/fi...

28 Apr at 18:55

Removing %20 from URI Relative Path

Removing %20 from URI Relative Path I am generating a relative path from 1 directory to another. If the OutputDirectoryName property is a directory containing spaces, the spaces are encoded using %20,...

18 Apr at 17:38

Create new URI from Base URI and Relative Path - slash makes a difference?

Create new URI from Base URI and Relative Path - slash makes a difference? does a slash make difference when using [new URI(baseUri, relativePath)](http://msdn.microsoft.com/en-us/library/9hst1w91(v=v...

20 Mar at 20:4

Send a base64 image in HTML email

Send a base64 image in HTML email Using a rich-text editor, our users can drag and drop a saved image from their desktop to the editor. The image appears and displays properly in the web page after th...

26 Apr at 18:12

Assign BitmapImage from Resources.resx to Image.Source?

Assign BitmapImage from Resources.resx to Image.Source? I would like to assign a `BitmapImage` from my Resources.resx to an `Image`. Beforehand I saved a .png image to Resources.resx. This image is no...

24 Oct at 12:32

How to encode a path that contains a hash?

How to encode a path that contains a hash? How do you properly encode a that includes a in it? Note the hash is not the fragment (bookmark?) indicator but part of the path name. For example, if there ...

16 Feb at 21:53