我有以下功能,我从控制台应用程序调用,我在本地计算机上运行:
Private Sub goNGetIt()
Dim remoteUri As String = "https://url"
Dim fileName As String = "C:\"
Dim username As String
Dim pass As String = Nothing
Dim key As ConsoleKeyInfo
Console.WriteLine("Enter username: ")
username = Console.ReadLine()
Console.WriteLine("Enter password: ")
key = Console.ReadKey(True)
Do While key.Key <> ConsoleKey.Enter
If key.Key <> ConsoleKey.Backspace Then
pass = pass + key.KeyChar
Console.Write("*")
Else
Console.Write("\b")
End If
key = Console.ReadKey(True)
Loop
Console.WriteLine()
Dim cred As New NetworkCredential(username, pass)
Dim myStringWebResource As String = Nothing
Dim myWebClient As New WebClient()
myWebClient.Credentials = cred
myStringWebResource = remoteUri
Console.WriteLine("Downloading File ""{0}"" from ""{1}"" ......." + ControlChars.Cr + ControlChars.Cr, fileName, myStringWebResource)
Try
myWebClient.DownloadFile(myStringWebResource, fileName)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Console.WriteLine("Successfully Downloaded file ""{0}"" from ""{1}""", fileName, myStringWebResource)
End Sub
我基本上调用此函数在本地下载文件,然后处理它,并将其移动到数据库中(位于另一种方法中)。
我无法使用securestring,因为我发送请求的服务器不会接受它们,而我无法控制它。
我的问题是这样的:一旦我的请求在线上,它包裹在SSL中,密码是否明文是否重要?
此外,如果在这个过程中有改进的余地,我很乐意听到。
感谢您提前协助。