删除文件或文件夹 [英] Delete file or folder

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

问题描述

亲爱的朋友们,


无论如何要在vb中编写程序以删除计算机中的文件?例如,我在C盘中有一个.txt文件,这是C:\ testing.txt。所以,现在我想点击vb中的一个按钮并删除这个文件。当然,我想从计算机中删除任何文件,所以我希望可以有一个文本框或一些下拉框,可以从我的电脑中选择任何文件。


是吗可能吗?


感谢任何回复。谢谢。


最好的问候。

解决方案

展开 | 选择 | Wrap | 行号

亲爱的Geoff,


我试过了代码,但没有出现。我的意思是我为Drive1放了一个组合框,File1和Dir1的文本框。当我运行程序时,它没有出现任何东西。组合框和文本框为空。会发生什么?


那么,你的意思是我可以选择我想要的文件,因为这个浏览器?(它被称为浏览器对吗?^^)但是我需要按删除按钮在我的键盘上删除文件。实际上,我想直接在VB中删除文件,但不要按键盘。


感谢您的回复。


最好的问候。



亲爱的Geoff,


我试过这段代码,但没有出现。我的意思是我为Drive1放了一个组合框,File1和Dir1的文本框。当我运行程序时,它没有出现任何东西。组合框和文本框为空。会发生什么?


那么,你的意思是我可以选择我想要的文件,因为这个浏览器?(它被称为浏览器对吗?^^)但是我需要按删除按钮在我的键盘上删除文件。实际上,我想直接在VB中删除文件,但不要按键盘。


感谢您的回复。


最好的问候。


展开 | 选择 | Wrap | 行号


Dear friends,

Is there anyway to write a program in vb in order to delete a file in my computer?For instance, I have a .txt file in C Drive, which is "C:\testing.txt". So, now I want to click a button in vb and delete this file. Of course, I would like to delete any file from the computer, so I hope can have a text box or some drop down box that can choose any files from my computer.

Is it possible?

Appreciate for any reply. Thank you.

Best Regards.

解决方案

Expand|Select|Wrap|Line Numbers


Dear Geoff,

I had tried the code, but there is nothing appear. I mean I had put a combo box for Drive1, text boxes for File1 and Dir1. When I run the program, it did not appear anything. The Combo box and text boxes are empty. What happen?

By the way, do you mean that I can choose the file I want because of this "browser"?(It is called a browser right? ^^ ) But I need to press "delete" at my keyboard to delete the file. Actually, I would like to delete a file in VB directly, but not pressing the keyboard.

Thanks for the reply.

Best Regards.


Dear Geoff,

I had tried the code, but there is nothing appear. I mean I had put a combo box for Drive1, text boxes for File1 and Dir1. When I run the program, it did not appear anything. The Combo box and text boxes are empty. What happen?

By the way, do you mean that I can choose the file I want because of this "browser"?(It is called a browser right? ^^ ) But I need to press "delete" at my keyboard to delete the file. Actually, I would like to delete a file in VB directly, but not pressing the keyboard.

Thanks for the reply.

Best Regards.


Expand|Select|Wrap|Line Numbers


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

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