在vb.net代码中访问安装目录中的文件 [英] Accessing file in installation directory in vb.net code

查看:122
本文介绍了在vb.net代码中访问安装目录中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提前感谢您的帮助!

我的解决方案中有一个安装项目.安装项目包含我想包含在安装目录中的文件(模板文件,README文档等).

I have an installation project in my solution. The installation project includes files that I would like to include in the install directory (template files, README docs, etc.).

具体来说,我想在代码中访问模板文件,以便我可以打开它并用实时数据填充它.在运行时,如何查看用户在哪里安装了应用程序并访问了该模板文件?

The template file, specifically, I would like to access in my code so that I can open it and populate it with real-time data. At run-time, how can I see where the user installed the application and access that template file?

使用Visual Studio 2010(完整版)

Using Visual Studio 2010 (full version)

语言:VB.NET

推荐答案

您在客户端PC中安装的.net软件 在安装路径时,在应用程序文件夹的资源文件夹中获取并添加图像template.doc等文件,并在客户端PC中动态访问文件

Your .net software installed in client pc At the time of installation path get and add your images template.doc etc file in resources folder of applications folder and access fileof dynamically in client pc

string path = Path.GetDirectoryName(Application.ExecutablePath);

并在使用资源文件夹访问安装软件后获取安装软件的路径

and get path of installation software after that use resources folder to access it

这篇关于在vb.net代码中访问安装目录中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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