我想删除文件老是删除不掉啊,出现虚拟路径不正确,谢谢帮忙!!!if(userclass.Trim()=="系统管理员")
{
string path=Server.MapPath("../upfiles/")+(string)MyDataGrid.DataKeys[e.Item.ItemIndex];;
File.Delete(path); if(File.Exists(path))
{
File.Delete(path) ;
myLabel.Text="删除文件成功";
if(MyDataGrid.CurrentPageIndex>0)
{
MyDataGrid.CurrentPageIndex= MyDataGrid.CurrentPageIndex-1;
}
getFile();
}
{
string path=Server.MapPath("../upfiles/")+(string)MyDataGrid.DataKeys[e.Item.ItemIndex];;
File.Delete(path); if(File.Exists(path))
{
File.Delete(path) ;
myLabel.Text="删除文件成功";
if(MyDataGrid.CurrentPageIndex>0)
{
MyDataGrid.CurrentPageIndex= MyDataGrid.CurrentPageIndex-1;
}
getFile();
}
File.Delete(path); if(File.Exists(path))
{
File.Delete(path)
???