Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复硬编码要求 http 开头链接导致 #3985 #3992

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Plain Craft Launcher 2/Modules/Base/ModBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2186,14 +2186,15 @@ NextElement:
''' </summary>
Public Sub OpenWebsite(Url As String)
Try
If Not Url.StartsWithF("http", True) Then Throw New Exception(Url & " 不是一个有效的网址,它必须以 http 开头!")
Log("[System] 正在打开网页:" & Url)
Process.Start(Url)
Catch ex As Exception
Log(ex, "无法打开网页(" & Url & ")")
ClipboardSet(Url, False)
MyMsgBox("可能由于浏览器未正确配置,PCL 无法为你打开网页。" & vbCrLf & "网址已经复制到剪贴板,若有需要可以手动粘贴访问。" & vbCrLf &
$"网址:{Url}", "无法打开网页")
Log("[System] 正在打开链接:" & Url)
Process.Start(Url)
Catch ex As Exception

Log(ex, "无法打开链接(" & Url & ")")
ClipboardSet(Url, False)
MyMsgBox("可能由于系统未配置相应的应用,PCL 无法为你打开这个链接。" & vbCrLf &
"链接已经复制到剪贴板,若有需要可以手动粘贴访问。" & vbCrLf &
$"链接:{Url}", "无法打开链接")
End Try
End Sub
''' <summary>
Expand Down Expand Up @@ -2713,4 +2714,4 @@ Retry:

#End Region

End Module
End Module