如何删除文件 [英] How to delete a file

查看:79
本文介绍了如何删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI专家



我的项目中有一个gridview。它包含4个链接按钮和一个编辑和删除按钮。我在所有4个链接按钮中都放了一个删除按钮。如果用户想要删除特定链接,我必须删除linkreference文件。我不知道怎么做。

请提供您的建议。



Rgds

Jagadesh

HI Experts

I had a gridview in my project. It contains 4 Link button and one edit and Delete button. And i placed one delete button in all of my 4 Link buttons. If user want to delete particular link i have to remove the linkreference file. I dont know how to do this.
Kindly provide your suggestions.

Rgds
Jagadesh

推荐答案

请参阅以下链接以获取特定链接命中的文件名。它将进入gridview rowcommand或链接按钮单击事件。只需尝试一种类型....



获取行命令中的文件路径

并使用此行删除



asp.net-gridview --- get-row-index-on-rowcommand-and-click-events.aspx



See the below links to get file name on a particular link hit. It will get on gridview rowcommand or link button click event . just try one type....

ANd get the file path in row command
and use just this line to delete

asp.net-gridview---get-row-index-on-rowcommand-and-click-events.aspx

//namespace:
using System.IO;
//code command:
File.Delete(path);


'使用followint命令删除abc.txt



System.IO.File.Delete(d:\ abc.txt)
'use the followint command to dele abc.txt

System.IO.File.Delete("d:\abc.txt")


这篇关于如何删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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