mirror of
https://github.com/ckaczor/Common.git
synced 2026-02-17 02:51:47 -05:00
Add GetAbsoluteUrlString
This commit is contained in:
@@ -146,6 +146,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="DateTimeExtensions.cs" />
|
<Compile Include="DateTimeExtensions.cs" />
|
||||||
|
<Compile Include="Internet\UrlHelper.cs" />
|
||||||
<Compile Include="IO\ProcessAsync.cs" />
|
<Compile Include="IO\ProcessAsync.cs" />
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
|
|||||||
15
Internet/UrlHelper.cs
Normal file
15
Internet/UrlHelper.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Common.Internet
|
||||||
|
{
|
||||||
|
public static class UrlHelper
|
||||||
|
{
|
||||||
|
public static string GetAbsoluteUrlString(string baseUrl, string url)
|
||||||
|
{
|
||||||
|
var uri = new Uri(url, UriKind.RelativeOrAbsolute);
|
||||||
|
if (!uri.IsAbsoluteUri)
|
||||||
|
uri = new Uri(new Uri(baseUrl), uri);
|
||||||
|
return uri.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user