我需要上传一些DATA和FTP服务器。 关于如何上传FILE内容和FTP一切正常的stackoverflowpost。 现在我正在努力改善我的上传。 而是收集DATA,将它们写入FILE然后在FTP中上传文件我想收集DATA并上传它们而不创建本地文件。 为此,我执行以下操作: string uri = “ftp://” + ftpServerIp + “/” + fileToUpload.Name; System.Net.FtpWebRequest reqFTP; // Create FtpWebRequest object from the Uri provided reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(“ftp://” + ftpServerIp + “/” + fileToUpload.Name)); // Provide the WebPermission Credintials reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); // By default KeepAlive is true, where the control connection […]
我正在编写一个系统,其中包含一个小的FTP模块,它根本不是主要function,但需要…… 我必须将进度条与WebClient类事件DownloadProgressChangedEventHandler和AsyncCompletedEventHandler链接,进度条增量正常,并且ASyncCompletedEventHandler启动MessageBox(按预期),问题是进度条看到加载太慢… 问题: 我的MessageBox弹出100%(由事件处理程序启动),但是当MessageBox弹出我的进度条仅为+ -80%(但.VALUE真的是100)时,第一个虽然我有,但是他们添加了一个Windows Vista中的“平滑”效果会使进度条相对于其真实值减慢速度。 如果您有任何人遇到同样的问题,感谢您的帮助。
我有一个包含一些FTP pathes的数组,如下所示: “FTP // IP /目录/ directory1中”, “FTP // IP /目录/ directory2” “FTP // IP /目录/ file.txt的”, “FTP // IP /目录/ directory3目录”, “FTP // IP /目录/ another_file.csv” 如何确定路径是文件还是目录? 提前致谢。
如何使用c#代码下载.zip文件格式? 这是代码,我用来下载。 只是为了突出显示,如果我下载.txt文件,它工作正常。 如果我下载.zip文件,它会下载.zip文件,但我无法打开它。 它抱怨.zip的格式不正确。 我怀疑我如何在本地驱动器上写回文件。 救命? string ftpServerIP = FTPServer; string ftpUserID = FTPUser; string ftpPassword = FTPPwd; FileInfo fileInf = new FileInfo(FileName); string uri = “ftp://” + ftpServerIP + “/” + fileInf.Name; FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(uri); //new Uri(“ftp://” + ftpServerIP + DestinationFolder + fileInf.Name)); reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); reqFTP.EnableSsl = true; reqFTP.KeepAlive […]
是否有任何基于.NET的开源(没有Win32本机,ActiveX,COM +等)库,所以我可以轻松设置一个ftp服务器? 它将是一个ftp服务器,它将更新SQL Server数据库,而不是常规文件。 谢谢。
我尝试使用FtpWebRequest列出文件详细信息但很常见它因WebException而失败并显示错误530用户未登录。 这怎么可能,它在某些时候使用相同的凭据工作? 摘自代码: reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpuri)); reqFTP.UseBinary = true; reqFTP.Credentials = new NetworkCredential(userName, password); string[] downloadFiles = new string[0]; reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails; WebResponse response = reqFTP.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); downloadFiles = reader.ReadToEnd().Replace(“\r\n”, “¤”).Split(‘¤’); reader.Close(); response.Close();
有人可以看看下面的代码并告诉我我做错了什么。 我只是在圈子里,任何指针都非常感激 public class FtpWebRequestUtil { private static string RemoteHost; private static string RemoteFtpPath; public static NetworkCredential Credential = new NetworkCredential(); public FtpWebRequestUtil() { } public FtpWebRequestUtil(string RemoteAddress, string RemotePath, string RemoteUser, string RemotePwd) { Credential.UserName = RemoteUser; Credential.Password = RemotePwd; RemoteHost = RemoteAddress; RemoteFtpPath = RemotePath; } public string UploadFile(string localFilePath) { int startTime […]
我知道这可能是这个问题的重复: 如何加密sql server中的数据并在.net应用程序中解密 – 但这是近一年前问的,我希望可能有进步或其他东西。 无论如何,我们有一个应用程序,FTP文件从一个位置到另一个位置,显然FTP配置文件需要一个密码。 我们有一个包含配置文件所有详细信息的数据库,但我们需要加密密码。 我们已经考虑过在SQL中解密然后将它们发送到应用程序,但这意味着通过网络发送它,这是我们不想要的。 我们想要加密存储的密码,将详细信息传递给应用程序,然后在应用程序中解密它们。 这可能吗? 从我的谷歌搜索,它似乎不是,但我希望有人有一个技巧或东西。 提前致谢! 注意:我使用的是.Net 4和SQL Server 2008 R2。
我正在尝试将MemoryStream的.docx文件上传到FTP 但是上传完成后,文件为空。 MemoryStream mms = new MemoryStream(); document2.SaveToStream(mms, Spire.Doc.FileFormat.Docx); string ftpAddress = “example”; string username = “example”; string password = “example”; using (StreamReader stream = new StreamReader(mms)) { // adnu is a random file name. WebRequest request = WebRequest.Create(“ftp://” + ftpAddress + “/public_html/b/” + adnu + “.docx”); request.Method = WebRequestMethods.Ftp.UploadFile; request.Credentials = new NetworkCredential(username, password); […]
有没有参考C#,我能够将一些文件从我的计算机(程序运行的地方)上传到我的FTP,这是另外的,并再次将这些文件下载到我的另一台计算机(在我运行的另一台计算机上)程序再次。)