mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Fix URIBuilder from String
This commit is contained in:
parent
f54382f5c3
commit
446719486a
@ -7,6 +7,7 @@ using Prism.Services;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Xamarin.Forms;
|
||||
@ -69,7 +70,17 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(Server);
|
||||
string server_address = "";
|
||||
if(Regex.IsMatch(Server, "([a-zA-Z]{2,20}):\\/\\/", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, TimeSpan.FromSeconds(1)))
|
||||
{
|
||||
server_address = Server;
|
||||
}
|
||||
else
|
||||
{
|
||||
server_address = "http://" + Server;
|
||||
}
|
||||
|
||||
UriBuilder builder = new UriBuilder(server_address);
|
||||
if (builder.Port == 80)
|
||||
{
|
||||
builder.Port = 59661;
|
||||
@ -170,6 +181,10 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
|
||||
LoadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
IsBusy = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnNavigatedFrom(INavigationParameters parameters)
|
||||
|
Loading…
x
Reference in New Issue
Block a user