从外部位置访问资源文件 [英] accessing the resource file from external location

查看:80
本文介绍了从外部位置访问资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我只在我的程序集中使用我的资源文件,因此在Resourcemanager中我使用它像ResourceManager(namespace.Login,GetType(LoginForm).Assembly)



假设我有资源文件Login.resx保存在路径C:/login.resx上,现在我想在函数ResourceManager中使用这个文件,但是我没有得到如何做它

所以可以请帮助我。

currently I am having my resource file in my assembly only, so in Resourcemanager I am using it like ResourceManager(namespace.Login, GetType(LoginForm).Assembly)

Suppose I have resource file Login.resx kept on path C:/login.resx, Now I want to use this file in function ResourceManager, but I am not getting how to do it
so can anybody please help me.

推荐答案

我得到了解决方案:

1.首先将资源文件保存在某些文件夹中,如C:// abc / resource.resx

2.使用visual studio命令提示符编译这些文件:resgen resource.resx

3.使用以下代码访问文件

Dim rm As ResourceManager

rm = ResourceManager.CreateFileBasedResourceManager(resource,C:\ abc,Nothing)
I got the solution :
1.First keep the resourse files in some folder like C://abc/resource.resx
2.Compile those file using visual studio command prompt: resgen resource.resx
3.use the below code to acces the file
Dim rm As ResourceManager
rm = ResourceManager.CreateFileBasedResourceManager("resource", "C:\abc", Nothing)


这篇关于从外部位置访问资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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