Created
October 1, 2015 15:03
-
-
Save codingbadger/5f3f1668fede96e56cc8 to your computer and use it in GitHub Desktop.
EncodedFtp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string remoteFileName = "你好世界.txt"; | |
string remoteHost = "ftp://someftpsite.com/somedirectory"; | |
string fullFtpUrl = string.format("{0}//{1}", remoteHost, remoteFileName); | |
var encodedFtpUrl = Uri.EscapeUriString(Encoding.UTF8.GetString(Encoding.ASCII.GetBytes(fullFtpUrl))); | |
var request = (FtpWebRequest)WebRequest.Create(encodedFtpUrl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment