q求大神帮助

问题描述

usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Xml.Linq;usingSystem.IO;publicpartialclassfileManage_fileList:System.Web.UI.Page{BaseClassbc=newBaseClass();protectedvoidPage_Load(objectsender,EventArgse){GridView1.DataSource=bc.GetDataSet("select*from[file]","file");GridView1.DataKeyNames=newstring[]{"fileID"};GridView1.DataBind();}protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse){//清除相片文件(服务器)DataSetds=bc.GetDataSet("select*from[file]wherefileID='"+this.GridView1.DataKeys[e.RowIndex].Value.ToString()+"'","file");DataRow[]row=ds.Tables[0].Select();foreach(DataRowrsinrow)//将检索到的数据逐一,循环添加到Listbox1中{FileInfofile=newFileInfo(Server.MapPath(rs["Path"].ToString()));file.Delete()在这里会提示异常System.IO.IOExeception怎么解决}//清除数据bc.ExecSQL("deletefrom[file]wherefileID='"+this.GridView1.DataKeys[e.RowIndex].Value.ToString()+"'");GridView1.DataSource=bc.GetDataSet("select*from[file]","[file]");GridView1.DataBind();}protectedvoidGridView1_PageIndexChanging(objectsender,GridViewPageEventArgse){GridView1.PageIndex=e.NewPageIndex;GridView1.DataBind();}}

解决方案

解决方案二:
看下要删除的文件是否存在?
解决方案三:
不让删除,有多种可能:1.配置错误,要删除的文件不存在。2.文件被其他进程打开3.文件没有操作权限,特别是win2008及以后系统,需要授权
解决方案四:
存在的,我都确认过了
解决方案五:
引用3楼dai1130的回复:

存在的,我都确认过了

文件被其他进程独占?

时间: 2024-09-17 03:57:56

q求大神帮助的相关文章

二叉树 求结点个数-c++编程,,跪求大神解答

问题描述 c++编程,,跪求大神解答 #include using namespace std; template struct BiNode { BiNode *lchild; datatype data; BiNode *rchild; }; template struct element { BiNode *ptr; int flag; }; BiNode *first,*bt,*q,*temp,stack[20],queue[20]; element s[20]; int count=0

poj3295 运行输入之后就崩溃了 求大神看看 英汉题意如下

问题描述 poj3295 运行输入之后就崩溃了 求大神看看 英汉题意如下 Description WFF 'N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any string of these s

c++-C++问题,关于模板类和类模板,求大神帮助

问题描述 C++问题,关于模板类和类模板,求大神帮助 不知道错的原因,希望大神帮忙解决,不胜感激. #include<iostream>using namespace std;template <class T>class List{public: List(T *elem); void Traverse();private: typedef struct LNode { T *m_elem; struct LNode *next; }Node*LinkNode; LinkNode

编码-哈夫曼编译码器,求大神帮忙看看译码的部分,为什么编译不出来?还有可以帮忙加入一段写入文件的程序吗?

问题描述 哈夫曼编译码器,求大神帮忙看看译码的部分,为什么编译不出来?还有可以帮忙加入一段写入文件的程序吗? #include #include #include #define maxsize 100 #define maxsize_1 1000 #define max 100 typedef struct { char data; int weight; int parent; int lchild; int rchild; }huffnode; typedef struct { char

一段简单的c代码,一直报错,求大神们指点

问题描述 一段简单的c代码,一直报错,求大神们指点 char * reverse_str(char *s){ char *p = s; char *q = s; char temp = 0; while(*q != ''){ q++; } q--;//前一个字符 while(p < q){ temp = *p; *p = *q; *q = temp; p++; q--; } return s; } 调试之后发现是交换那段循环的问题,不知道问题出在哪,求指点! 解决方案 http://codepa

代码 24点 c语言-一个C编写的求24点问题,求大神帮忙纠错

问题描述 一个C编写的求24点问题,求大神帮忙纠错 #include int main() { int mode,i,j,k,sum,p,q,flag=1; int a[4]; for(i=0; i<4; i++) { scanf("%d",&a[i]); } while(a[0]+a[1]+a[2]+a[3]!=0) { flag=1; for(i=0; i<4 && flag; i++) { for(j=i+1; j<4 &&

用户权限-W7系统,安装天翼校园客户端没有最高权限,求大神解答。不胜感激!

问题描述 W7系统,安装天翼校园客户端没有最高权限,求大神解答.不胜感激! W7系统,安装天翼校园客户端没有最高权限,求大神解答.不胜感激! 安装错误提示: 您的用户权限不足,请使用管理员权限执行安装程序!安装退出. 可以留下QQ或者加Q:627984813 不胜感激哪!~~~ 解决方案 1055258954

大二狗求大神解决数据结构里压缩矩阵程序的问题,悬赏5c币!

问题描述 大二狗求大神解决数据结构里压缩矩阵程序的问题,悬赏5c币! 5C #include using namespace std;#define N 10typedef struct{ int ij; int e;}tsMatrix;typedef struct{ tsMatrix data[N];/*最大长度为N */ int munutu;}TSMatrix; int FastTransposeSMatrix(TSMatrix MTSMatrix T) // 快速转置{int colpq

ubuntu bochs-新手,学习自己动手写操作系统,卡在bochs配置,求大神救助

问题描述 新手,学习自己动手写操作系统,卡在bochs配置,求大神救助 1.bochs版本:bochs-2.6.8 编译前配置:提取文件,打开目录,在终端中打开; ./configure --enable debugger --enable-disasm sudo make sudo make install 安装完成,提前安装了一些需要的程序,未报错. 2.编辑bochesrc sudo gedit 然后用gedit打开/ect/bochs-init/bochsrc,编辑内容如下: #####