我现在对代码非常困惑。我有一个CarPhoto对象,并在该对象是一个PhotoList列表。在该列表中是指向位于我的FTP服务器上的照片的链接。为什么我的URI不被支持? FileInfo Argumentexception
当我尝试删除该文件,我得到这个消息:
类型“System.ArgumentException”未处理的异常出现在mscorlib.dll
其他信息:URI格式不被支持。
下面的代码:
private void delete_Button_Click_1(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Wilt u deze foto echt verwijderen?", "Foto verwijderen", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
int index = imageLinkList.SelectedIndex;
CarPhoto photo = car.PhotoList[index];
FileInfo fi = new FileInfo(photo.Photolink); //The exception gets thrown here.The link is: http://pqrojectqars.herobo.com/Images/Fiat/Punto/Wit/40.jpg
string extension = fi.Extension;
}
}
有人能帮助我吗?
'FileInfo'描述了一个位于本地机器或UNC上的文件。它无法描述位于FTP服务器上的远程文件。 –