I have an app which will download publicly available data as a string
from a website.
The below code on a WinForm app on Windows 10 works perfectly, but it doesn't work at all on Windows Server 2019.
I have tried enabling the "Allow App Through Firewall" option & have also tried allowing the program in outbound rules in the firewall, but nothing is working.
What is the issue?
Private Async Function Run_WebRequest(URL As String) As Task(Of String)
Try
Dim client As WebClient = New WebClient()
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
client.Headers.Add("scheme", "https")
client.Headers.Add("accept-language", "en-US, en;q=0.9, ml;q=0.8")
Dim Response = client.DownloadString(URL)
Return Response
Catch ex As Exception
Return ex.ToString
End Try
End Function
I missed to add that this is a Virtual Private Server OS Windows Server 2019 from Contabo hosting services
Please see below screenshot of the app which is a standalone exe file with three buttons having different Webclients for testing, none of them works on