Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

open url in c#

var uri = "https://www.google.com";
var psi = new System.Diagnostics.ProcessStartInfo();
psi.UseShellExecute = true;
psi.FileName = uri;
System.Diagnostics.Process.Start(psi);
Comment

c# open url

private void OpenUrl(string url)
{
    try
    {
        Process.Start(url);
    }
    catch
    {
        // hack because of this: https://github.com/dotnet/corefx/issues/10361
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            url = url.Replace("&", "^&");
            Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
        }
        else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
        {
            Process.Start("xdg-open", url);
        }
        else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
        {
            Process.Start("open", url);
        }
        else
        {
            throw;
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: bitmasking in c# 
Csharp :: make winforms full-screen c# 
Csharp :: csgo throw last grenade bind 
Csharp :: c# sleep 1 second 
Csharp :: create or update in laaravel 
Csharp :: c# copy file to directory 
Csharp :: c# preprocessor if not 
Csharp :: how to unlock cursor in unity 
Csharp :: c# get date 
Csharp :: c# random enum 
Csharp :: rigidbody2d freeze position 
Csharp :: how to change the color of your text in c# 
Csharp :: c# get all inherited classes of a class 
Csharp :: unity change text 
Csharp :: writeline c# 
Csharp :: convert timestamp to datetime c# code 
Csharp :: init dictionary c# 
Csharp :: creatw list of int in C# 
Csharp :: button color uwp c# 
Csharp :: bitmap to byte array c# 
Csharp :: how to change scenes with button press in unity c# 
Csharp :: how to detect when a player move in unity 
Csharp :: how to instantiate as child unity 
Csharp :: There is already a virtual axis named Horizontal registered. unity 
Csharp :: pass parameter to thread c# 
Csharp :: c# download file 
Csharp :: unity get direction from one point to another 
Csharp :: unity keep rotating object 
Csharp :: application server types in .net 
Csharp :: enable canvas unity 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =