forked from cyberofficial/Synthalingua_Wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebManager.vb
More file actions
30 lines (26 loc) · 1.08 KB
/
Copy pathWebManager.vb
File metadata and controls
30 lines (26 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Public Class WebManager
Public Shared Function GetWebLink(portNumber As Integer, linkType As String) As String
Return $"http://localhost:{portNumber}?show{linkType}"
End Function
Public Shared Sub CopyWebLinkToClipboard(portNumber As Integer, linkType As String)
Dim url As String = GetWebLink(portNumber, linkType)
Clipboard.SetText(url)
MessageBox.Show($"Copied {url} to clipboard")
End Sub
Public Shared Sub OpenSocialLink(url As String)
Process.Start(New ProcessStartInfo(url) With {.UseShellExecute = True})
End Sub
Public Shared Function ValidateHLSPassword(url As String, showPassword As Boolean) As String
If showPassword Then
Return New String("*"c, url.Length)
End If
Return url
End Function
Public Shared Sub ShowSubtitleWindow(webServerEnabled As Boolean, subtitleWindow As Form)
If webServerEnabled Then
subtitleWindow.Show()
Else
MessageBox.Show("Please enable the web server to use this feature.")
End If
End Sub
End Class