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 :: frame time unity 
Csharp :: compare two binary tree 
Csharp :: c# list remove duplicate items 
Csharp :: discord bot status code c# 
Csharp :: c# update value in a json file 
Csharp :: c# remove spaces from string 
Csharp :: how to start cmd in c# 
Csharp :: how to spawn a object in unity 
Csharp :: list with two values c# 
Csharp :: c# compile just one exe 
Csharp :: c# how to refreshyour bindingsource 
Csharp :: c# object to dictionary 
Csharp :: convert string to date in c# 
Csharp :: c# list of strings 
Csharp :: placeholder syntax c# 
Csharp :: triangle minimum path sum 
Csharp :: how to use distinct in linq query in c# 
Csharp :: loading screen unity 
Csharp :: c# string to variable name 
Csharp :: c# get pressed key 
Csharp :: Cursor Lock and Visible in Unity 
Csharp :: unity RemoveComponent 
Csharp :: c# ftp file download 
Csharp :: make string uppercase c# 
Csharp :: unity key down 
Csharp :: how to verify the scene unity 
Csharp :: c# create list with range 
Csharp :: .net get system environment variable 
Csharp :: can you have multiple statement in a case c# 
Csharp :: c# int array length 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =