VB.NET FTP错误550 [英] VB.NET FTP Error 550

查看:295
本文介绍了VB.NET FTP错误550的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试。集成电路文件上传到活动的FTP服务器

I try to upload '.ics' Files to an active FTP Server

命名空间:

Imports System
Imports System.IO
Imports System.Data.OleDb
Imports System.Collections
Imports Microsoft.VisualBasic
Imports System.Net
Imports System.Text

code:

Code:

'Create a FTP Request Object and Specfiy a Complete Path
                Dim reqObj As FtpWebRequest = WebRequest.Create(Ziel + "Calendar/" + MitarbeiterNr + ".ics")
                reqObj.Method = WebRequestMethods.Ftp.UploadFile
                reqObj.UsePassive = False
                reqObj.Credentials = New NetworkCredential(User, Password)
                reqObj.Proxy = Nothing
                reqObj.KeepAlive = False
                reqObj.UseBinary = False
                reqObj.Timeout = 5000


                Dim sourceStream As FileStream = File.OpenRead(AppPath + "Ablage\" + MitarbeiterNr + "\" + MitarbeiterNr + ".ics") ' store file in buffer
                Dim buffer(Convert.ToInt32(sourceStream.Length)) As Byte
                sourceStream.Read(buffer, 0, buffer.Length)
                sourceStream.Close()
                reqObj.ContentLength = buffer.Length
                'Dim objUTF8 As New UTF8Encoding()
                'lblMsg.Text &= objUTF8.GetString(buffer)


                'Upload File and set its object to nothing
                Dim requestStream As System.IO.Stream
                Try
                    requestStream = reqObj.GetRequestStream() 'times out here
                    requestStream.Write(buffer, 0, buffer.Length)
                    requestStream.Close()
                Catch ex As Exception
                    Debug.printMeldung(ex.Message & ex.Source & ex.StackTrace)
                End Try


                reqObj = Nothing

所用的用户对写作等所需要的权利 在URI看起来像

The used User has the needed rights for Writing etc. the URI looks like

ftp://Serveradress/Calendar/filename.ics

下面是错误消息我得到由 requestStrem = reqObj.GetRequestStream()

Here is the Error Message I get by requestStrem = reqObj.GetRequestStream():

明镜REMOTESERVER帽子einen Fehlerzurückgegeben(550)Datei nicht   verfügbar(ZB nicht gefunden奥德kein Zugriff)。系统蓓   System.Net.FtpWebRequest.SyncRequestCallback(obj对象)北   System.Net.FtpWebRequest.RequestCallback(obj对象)北   System.Net.CommandStream.InvokeRequestCallback(obj对象)北   System.Net.CommandStream.Abort(例外五)北   System.Net.FtpWebRequest.FinishRequestStage(RequestStage阶段)北   System.Net.FtpWebRequest.GetRequestStream()北   Calendar.Calendar.Upload(字符串MitarbeiterNr)在DVisualStudio   2008CalendarCalendarCalendar.vbZeile 240。

Der Remoteserver hat einen Fehler zurückgegeben (550) Datei nicht verfügbar (z.B. nicht gefunden oder kein Zugriff).System bei System.Net.FtpWebRequest.SyncRequestCallback(Object obj) bei System.Net.FtpWebRequest.RequestCallback(Object obj) bei System.Net.CommandStream.InvokeRequestCallback(Object obj) bei System.Net.CommandStream.Abort(Exception e) bei System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage) bei System.Net.FtpWebRequest.GetRequestStream() bei Calendar.Calendar.Upload(String MitarbeiterNr) in DVisualStudio 2008CalendarCalendarCalendar.vbZeile 240.

对不起,这是在德国,但我认为你们中的大多数可以读取; - )

Sorry that it is in German but I think most of you can read that ;-)

我从这里夺走了code

I snatched the code from here

http://forums.asp.net/post/2590178.aspx

会很高兴,如果有人可以帮助我尽快解决这个问题=)

Would be happy if someone helps me to solve the Problem soon =)

LightMonk

LightMonk

推荐答案

经常检查你把一个双斜杠后的主机名和路径前FTP连接字符串,如: ftp.mickeymouse // htdocs目录/文件名。

Always check in FTP connection strings that you put a double slash after host name and before the path, e.g. ftp.mickeymouse//htdocs/filename.

当我有onlty 1斜线maqrk我得到了一个完全无用的错误550消息。

When I had onlty one slash maqrk I got a totally unhelpful error 550 message.

解决我的问题,虽然它可能不是与此有关。

Solved my problems, though it may not be relevant here.

这篇关于VB.NET FTP错误550的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆