Base for various helper functions for networking.
More...
|
static bool | OpenURL (string url) |
| Opens the given URL with the file explorer or browser. More...
|
|
static bool | RemoteCertificateValidationCallback (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) |
| HTTPS-certification callback. More...
|
|
static string | GetURLFromFile (string path) |
| Returns the URL of a given file. More...
|
|
static string | ValidateURL (string url, bool removeProtocol=false, bool removeWWW=true, bool removeSlash=true) |
| Validates a given URL. More...
|
|
static bool | isURL (string url) |
| Checks if the input is an URL. More...
|
|
static bool | isIPv4 (string ip) |
| Checks if the input is an IPv4 address. More...
|
|
static string | GetIP (string host) |
| Returns the IP of a given host name. More...
|
|
static string | ValidURLFromFilePath (string path) |
| Returns the URL of a given file. More...
|
|
static string | CleanUrl (string url, bool removeProtocol=true, bool removeWWW=true, bool removeSlash=true) |
| Cleans a given URL. More...
|
|
static bool | isValidURL (string url) |
| Checks if the URL is valid. More...
|
|
|
const string | FILE_PREFIX = "file://" |
|
const string | CONTENT_PREFIX = "content://" |
|
Base for various helper functions for networking.
◆ CleanUrl()
static string Crosstales.Common.Util.NetworkHelper.CleanUrl |
( |
string |
url, |
|
|
bool |
removeProtocol = true , |
|
|
bool |
removeWWW = true , |
|
|
bool |
removeSlash = true |
|
) |
| |
|
static |
Cleans a given URL.
- Parameters
-
url | URL to clean |
removeProtocol | Remove the protocol, e.g. http:// (optional, default: true) |
removeWWW | Remove www (optional, default: true) |
removeSlash | Remove slash at the end (optional, default: true) |
- Returns
- Clean URL
◆ GetIP()
static string Crosstales.Common.Util.NetworkHelper.GetIP |
( |
string |
host | ) |
|
|
static |
Returns the IP of a given host name.
- Parameters
-
- Returns
- IP of a given host name.
◆ GetURLFromFile()
static string Crosstales.Common.Util.NetworkHelper.GetURLFromFile |
( |
string |
path | ) |
|
|
static |
Returns the URL of a given file.
- Parameters
-
- Returns
- URL of the file path
◆ isIPv4()
static bool Crosstales.Common.Util.NetworkHelper.isIPv4 |
( |
string |
ip | ) |
|
|
static |
Checks if the input is an IPv4 address.
- Parameters
-
url | Input as possible IPv4 |
- Returns
- True if the given path is an IPv4 address
◆ isURL()
static bool Crosstales.Common.Util.NetworkHelper.isURL |
( |
string |
url | ) |
|
|
static |
Checks if the input is an URL.
- Parameters
-
- Returns
- True if the given path is an URL
◆ isValidURL()
static bool Crosstales.Common.Util.NetworkHelper.isValidURL |
( |
string |
url | ) |
|
|
static |
Checks if the URL is valid.
- Parameters
-
- Returns
- True if the URL is valid.
◆ OpenURL()
static bool Crosstales.Common.Util.NetworkHelper.OpenURL |
( |
string |
url | ) |
|
|
static |
Opens the given URL with the file explorer or browser.
- Parameters
-
- Returns
- True if the operation was successful
◆ RemoteCertificateValidationCallback()
static bool Crosstales.Common.Util.NetworkHelper.RemoteCertificateValidationCallback |
( |
object |
sender, |
|
|
System.Security.Cryptography.X509Certificates.X509Certificate |
certificate, |
|
|
System.Security.Cryptography.X509Certificates.X509Chain |
chain, |
|
|
System.Net.Security.SslPolicyErrors |
sslPolicyErrors |
|
) |
| |
|
static |
HTTPS-certification callback.
◆ ValidateURL()
static string Crosstales.Common.Util.NetworkHelper.ValidateURL |
( |
string |
url, |
|
|
bool |
removeProtocol = false , |
|
|
bool |
removeWWW = true , |
|
|
bool |
removeSlash = true |
|
) |
| |
|
static |
Validates a given URL.
- Parameters
-
url | URL to validate |
removeProtocol | Remove the protocol, e.g. http:// (optional, default: false) |
removeWWW | Remove www (optional, default: true) |
removeSlash | Remove slash at the end (optional, default: true) |
- Returns
- Clean URL
◆ ValidURLFromFilePath()
static string Crosstales.Common.Util.NetworkHelper.ValidURLFromFilePath |
( |
string |
path | ) |
|
|
static |
Returns the URL of a given file.
- Parameters
-
- Returns
- URL of the file path
◆ isInternetAvailable
bool Crosstales.Common.Util.NetworkHelper.isInternetAvailable |
|
staticget |
Checks if an Internet connection is available.
- Returns
- True if an Internet connection is available.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/RTVoice/RTVoicePro/Assets/Plugins/crosstales/Common/Scripts/Util/NetworkHelper.cs