Mephi 29. 7. 2010 17:41:58 Body: 625 Najaktívnejší č.: 32 FtpWebRequest Zdravim, mam nasledovnu metodu:public static Stream LoadStream(string sAddress) ...{ HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(sAddress); wr.KeepAlive = false; HttpWebResponse response = (HttpWebResponse)wr.GetResponse(); Stream inStream = response.GetResponseStream(); return inStream; }Chcel som tuto funkciu prepisat na FtpWebRequest, ale dava mi chybu: public static Stream LoadStream(string sAddress) ...{ FtpWebRequest ftpr = (FtpWebRequest)FtpWebRequest.Create(sAddress); ftpr.KeepAlive = false; FtpWebResponse response = (FtpWebResponse)ftpr.GetResponse(); Stream inStream = response.GetResponseStream(); response.Close(); return inStream; }Vypisuje nasledovny exception: "The requested URI is invalid for this FTP command." V com moze byt problem ? [Reakcia]
vlko 29. 7. 2010 22:38:27 Body: 35145 Najaktívnejší č.: 1 RE: FtpWebRequest Musis najskor adresu konvertnut na uri:public static Stream LoadStream(string sAddress)...{Uri target = new Uri (sAddress);FtpWebRequest ftpr = (FtpWebRequest)FtpWebRequest.Create(target); [Reakcia]