This commit is contained in:
JingHai-Lingyun
2024-06-10 12:04:52 +08:00
parent a18ccf78d1
commit aa5ff163e6
@@ -2185,8 +2185,13 @@ NextElement:
''' 打开网页。
''' </summary>
Public Sub OpenWebsite(Url As String)
' 允许 Minecraft 基岩版的 URLScheme (#3985)
If Url.StartsWithF("minecraft", True) Then
' 一定会被捕捉到错误,单独拎出来
Process.Start("minecraft://")
Else
Try
If Not Url.StartsWithF("http", True) Or Url = "minecraft://" Then Throw New Exception(Url & " 不是一个有效的网址,它必须以 http 开头!")
If Not Url.StartsWithF("http", True) Then Throw New Exception(Url & " 不是一个有效的网址,它必须以 http 开头!")
Log("[System] 正在打开网页:" & Url)
Process.Start(Url)
Catch ex As Exception
@@ -2195,6 +2200,7 @@ NextElement:
MyMsgBox("可能由于浏览器未正确配置,PCL 无法为你打开网页。" & vbCrLf & "网址已经复制到剪贴板,若有需要可以手动粘贴访问。" & vbCrLf &
$"网址:{Url}", "无法打开网页")
End Try
End If
End Sub
''' <summary>
''' 打开 explorer。注意参数中的路径要尽量加上双引号!