如何将文件保存为程序文件(VB net) [英] How to save a file as program's file (VB net )

查看:126
本文介绍了如何将文件保存为程序文件(VB net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我在visual studio中创建了一些vb net程序。 Doesent事实上他们是什么程序。它们包括一些标签和文本框。问题是我如何将文件保存在特定文件夹中作为具有当前文本框值的程序文件,然后当我单击该文件时打开我的程序具有这些值。因为许多程序都像办公室一样,你可以保存一个单词,excell,power point file等,当你重新打开它时,它会加载最后一个项目。

我在网上找不到任何similir



我尝试了什么:



我试过谷歌搜索得到一些想法,但我没有找到任何关于...

Hi everyone.
I have created some vb net programs in visual studio. Doesent matter what programms they are. They include some labels and text boxes. The question is how can i save a file on a specific folder as a program's file with current textbox values and then when i click on that file open my programm with these values. As so many programs do like office where you can save a word, excell, power point file etc and when you re open it it loads the last project.
I cant find nothing similir on the net

What I have tried:

I tried Google search to get some ideas but i didnt find anything about that ...

推荐答案

有两个部分这个问题;

首先

你需要创建一个文件关联 - 这告诉操作系统用什么应用程序打开文件

其次

您需要传递文件名&应用程序的路径



关于创建文件关联的不错的小型演示程序如下 - 相当陈旧但仍然合适

VB.NET中的文件关联 [ ^ ]



一次你已经这样做了,你将使用命令行参数检索文件的名称和路径



亲切的问候
There is two parts to this question;
Firstly
You need to create a File Association - this tells the operating system what application to open the file with
Secondly
You need to pass the file name & path to the application

Nice little demo program on creating a file association is below - quite old but nonetheless suitable
File Association in VB.NET[^]

Once you have done this you would retrieve the name and path of the file using the Command Line Arguments

Kind Regards


这篇关于如何将文件保存为程序文件(VB net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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