473,763 Members | 7,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resource file vs. regular Xml file

TS
i have a need to possibly enable mutli language support. What benefit do i
get by using a resource file instead of a custom xml solution?

thanks!
Nov 14 '07
12 5276
TS
i see that you can add resources to a resource file at runtime. My question
is, is that persisted to the file system or only in memory in which case a
server reboot would flush?

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:YO******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Thanks for your reply TS,

For resource file, normally you will add them into project through the
following means:

** You add a resource xml file(resx file) which can contain different kind
of resource objects(string, image, file .....). So you can add multiple
such resx files in a project. When you build the project, they will be
compiled(as embeded resource) into your assembly(or separate satellite
assemlies that contains resource for specific cultures).

For these kinds of resource, you'll use API to get resource item from
it(from assembly).

#Introduction to Resources and Localization
http://msdn2.microsoft.com/en-us/lib...93(VS.71).aspx

#Resources in Applications
http://msdn2.microsoft.com/en-us/lib...5x(vs.71).aspx
** For ASP.NET application, it has some further encapsulated
functionality.
You can provide a local resource file for each aspx page or serveral
global
resource files for the entire application. These resource items are easy
to reference in your aspx page(both through declarative syntax or
programatic code):

#using localization resource in ASP.NET:
http://quickstarts.asp.net/QuickStar...on/localizatio
n.aspx
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
>>From: "TS" <ma**********@n ospam.nospam>
Subject: Re: Resource file vs. regular Xml file
Date: Mon, 19 Nov 2007 16:42:09 -0600

steven, are resource files 1 per application or can they be split up to
have
>>many, say 1 per 10 pages of an application. IF so is there any reason to
do/not do this?

thanks!!!!

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:J2****** ********@TK2MSF TNGHUB02.phx.gb l...
>>Thanks for your followup TS,

If you're using .net resource model(resource file or embeded in
assembly),
>>then, you should not change them frequently or dynamically at runtime.
Because when .net application running, the resource items will be loaded
into memory after it is used, just like it load the required assemblies.
Therefore, it won't let you to flexibly update and refresh it
immediately
if you changed them when the application is running.

BTW, if you want to implement your own resource model and component,
maybe
>>you can havea look at the following article which introducing extending
the
NET resource provider:

#Extending the ASP.NET 2.0 Resource-Provider Model
http://msdn2.microsoft.com/en-us/library/aa905797.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "TS" <ma**********@n ospam.nospam>
Reference s: <OL************ **@TK2MSFTNGP03 .phx.gbl>
<eA********** ****@TK2MSFTNGP 05.phx.gbl>
<uU********** ****@TK2MSFTNGP 02.phx.gbl>
<ZR********** ****@TK2MSFTNGH UB02.phx.gbl>
Subject: Re: Resource file vs. regular Xml file
Date: Thu, 15 Nov 2007 08:15:57 -0600
thank you.

One concern i never asked was caching. currently i am caching my custom
xml
files. Do resource files get cached or need caching?

If for example my application was deployed and then we found out there
was
>>a
spelling mistake, I imaging we could manually update the resource file?
In
>>>>this scenario, how does caching play in?

thanks~!
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:ZR**** **********@TK2M SFTNGHUB02.phx. gbl...
Hi TS,
>
I think the main advantage of using .NET resource file(or resx file)
is
that you can make full use of the built-in API or coding syntax
support.
>>>>For example, .NET provide "ResourceManage r Class" to help you
programmati cally load resource keys from resource file or resx file.
Also,
net resource file can be embeded into assembly. If you're using
custom
xml solution, you'll need to define your own xml file format and use
raw
>>>>XML API to manipulate them. How do you think?
>
Sincerely ,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
--------------------
>>From: "TS" <ma**********@n ospam.nospam>
>>Reference s: <OL************ **@TK2MSFTNGP03 .phx.gbl>
<eA******** ******@TK2MSFTN GP05.phx.gbl>
>>Subject : Re: Resource file vs. regular Xml file
>>Date: Wed, 14 Nov 2007 12:00:41 -0600
>>
>>yes.
>>
>>do you know of the actual benefits of resource file instead of regular
xml
>>file?
>>
>>"Duy Lam" <du**********@g mail.comwrote in message
>>news:eA** ************@TK 2MSFTNGP05.phx. gbl...
>>TS wrote:
>>>i have a need to possibly enable mutli language support. What
benefit
>>>>do
>>>i get by using a resource file instead of a custom xml solution?
>>>>
>>>thanks !
>>>
>>I don't know what your "customer xml solution" is ? You store all
>>informati on of controls such as text, color value (#aabbcc) in a
regular
>>xml file, doesn't you ?
>>As far as I know, ASP.NET support resource file very well. So you
either
>>need a multi languages or not, you should use Resource Feature in
your
>>>>>>ASP.NET .
>>
>>
>>
>




Nov 20 '07 #11
Hi TS,

For the following things you mentioned:

==========
i see that you can add resources to a resource file at runtime.
=========

do you mean use "ResourceWriter " class to programmaticall y add resource
into existing resource file(resx or .resource...)? If so, the modification
only reflect on the resource file on disk and won't make the runtime to
automatically reload the updated resource.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "TS" <ma**********@n ospam.nospam>
Subject: Re: Resource file vs. regular Xml file
Date: Tue, 20 Nov 2007 10:24:45 -0600
>i see that you can add resources to a resource file at runtime. My
question
>is, is that persisted to the file system or only in memory in which case a
server reboot would flush?

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:YO******* *******@TK2MSFT NGHUB02.phx.gbl ...
>Thanks for your reply TS,

For resource file, normally you will add them into project through the
following means:

** You add a resource xml file(resx file) which can contain different
kind
>of resource objects(string, image, file .....). So you can add multiple
such resx files in a project. When you build the project, they will be
compiled(as embeded resource) into your assembly(or separate satellite
assemlies that contains resource for specific cultures).

For these kinds of resource, you'll use API to get resource item from
it(from assembly).

#Introductio n to Resources and Localization
http://msdn2.microsoft.com/en-us/lib...93(VS.71).aspx

#Resources in Applications
http://msdn2.microsoft.com/en-us/lib...5x(vs.71).aspx
** For ASP.NET application, it has some further encapsulated
functionalit y.
You can provide a local resource file for each aspx page or serveral
global
resource files for the entire application. These resource items are easy
to reference in your aspx page(both through declarative syntax or
programatic code):

#using localization resource in ASP.NET:
http://quickstarts.asp.net/QuickStar...on/localizatio
>n.aspx
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
>>>From: "TS" <ma**********@n ospam.nospam>
Subject: Re: Resource file vs. regular Xml file
Date: Mon, 19 Nov 2007 16:42:09 -0600

steven, are resource files 1 per application or can they be split up to
have
>>>many, say 1 per 10 pages of an application. IF so is there any reason to
do/not do this?

thanks!!!!

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:J2***** *********@TK2MS FTNGHUB02.phx.g bl...
Thanks for your followup TS,

If you're using .net resource model(resource file or embeded in
assembly),
>>>then, you should not change them frequently or dynamically at runtime.
Because when .net application running, the resource items will be
loaded
>>>into memory after it is used, just like it load the required
assemblies.
>>>Therefore, it won't let you to flexibly update and refresh it
immediatel y
if you changed them when the application is running.

BTW, if you want to implement your own resource model and component,
maybe
>>>you can havea look at the following article which introducing extending
the
NET resource provider:

#Extending the ASP.NET 2.0 Resource-Provider Model
http://msdn2.microsoft.com/en-us/library/aa905797.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>From: "TS" <ma**********@n ospam.nospam>
>References : <OL************ **@TK2MSFTNGP03 .phx.gbl>
<eA********* *****@TK2MSFTNG P05.phx.gbl>
<uU********* *****@TK2MSFTNG P02.phx.gbl>
<ZR********* *****@TK2MSFTNG HUB02.phx.gbl>
>Subject: Re: Resource file vs. regular Xml file
>Date: Thu, 15 Nov 2007 08:15:57 -0600

>
>thank you.
>
>One concern i never asked was caching. currently i am caching my custom
xml
>files. Do resource files get cached or need caching?
>
>If for example my application was deployed and then we found out there
was
>>>a
>spelling mistake, I imaging we could manually update the resource file?
In
>>>>>this scenario, how does caching play in?
>
>thanks~!
>
>
>"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
>news:ZR*** ***********@TK2 MSFTNGHUB02.phx .gbl...
>Hi TS,
>>
>I think the main advantage of using .NET resource file(or resx file)
>is
>that you can make full use of the built-in API or coding syntax
support.
>>>>>For example, .NET provide "ResourceManage r Class" to help you
>programmat ically load resource keys from resource file or resx file.
>Also,
>net resource file can be embeded into assembly. If you're using
>custom
>xml solution, you'll need to define your own xml file format and use
raw
>>>>>XML API to manipulate them. How do you think?
>>
>Sincerel y,
>>
>Steven Cheng
>>
>Microsof t MSDN Online Support Lead
>>
>>
>This posting is provided "AS IS" with no warranties, and confers no
>rights.
>>
>>
>--------------------
>>>From: "TS" <ma**********@n ospam.nospam>
>>>Referenc es: <OL************ **@TK2MSFTNGP03 .phx.gbl>
><eA******* *******@TK2MSFT NGP05.phx.gbl>
>>>Subjec t: Re: Resource file vs. regular Xml file
>>>Date: Wed, 14 Nov 2007 12:00:41 -0600
>>>
>>>yes.
>>>
>>>do you know of the actual benefits of resource file instead of
regular
>>>xml
>>>file?
>>>
>>>"Duy Lam" <du**********@g mail.comwrote in message
>>>news:eA* *************@T K2MSFTNGP05.phx .gbl...
>>>TS wrote:
>>>>i have a need to possibly enable mutli language support. What
benefit
>>>>>do
>>>>i get by using a resource file instead of a custom xml solution?
>>>>>
>>>>thank s!
>>>>
>>>I don't know what your "customer xml solution" is ? You store all
>>>informat ion of controls such as text, color value (#aabbcc) in a
regular
>>>xml file, doesn't you ?
>>>As far as I know, ASP.NET support resource file very well. So you
>either
>>>need a multi languages or not, you should use Resource Feature in
your
>>>>>>>ASP.NE T.
>>>
>>>
>>>
>>
>
>
>



Nov 21 '07 #12
TS
yes you are correct, thanks!

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:tn******** *******@TK2MSFT NGHUB02.phx.gbl ...
Hi TS,

For the following things you mentioned:

==========
i see that you can add resources to a resource file at runtime.
=========

do you mean use "ResourceWriter " class to programmaticall y add resource
into existing resource file(resx or .resource...)? If so, the modification
only reflect on the resource file on disk and won't make the runtime to
automatically reload the updated resource.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
>>From: "TS" <ma**********@n ospam.nospam>
Subject: Re: Resource file vs. regular Xml file
Date: Tue, 20 Nov 2007 10:24:45 -0600
>>i see that you can add resources to a resource file at runtime. My
question
>>is, is that persisted to the file system or only in memory in which case a
server reboot would flush?

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:YO****** ********@TK2MSF TNGHUB02.phx.gb l...
>>Thanks for your reply TS,

For resource file, normally you will add them into project through the
following means:

** You add a resource xml file(resx file) which can contain different
kind
>>of resource objects(string, image, file .....). So you can add multiple
such resx files in a project. When you build the project, they will be
compiled(as embeded resource) into your assembly(or separate satellite
assemlies that contains resource for specific cultures).

For these kinds of resource, you'll use API to get resource item from
it(from assembly).

#Introducti on to Resources and Localization
http://msdn2.microsoft.com/en-us/lib...93(VS.71).aspx

#Resources in Applications
http://msdn2.microsoft.com/en-us/lib...5x(vs.71).aspx
** For ASP.NET application, it has some further encapsulated
functionality .
You can provide a local resource file for each aspx page or serveral
global
resource files for the entire application. These resource items are
easy
to reference in your aspx page(both through declarative syntax or
programatic code):

#using localization resource in ASP.NET:
http://quickstarts.asp.net/QuickStar...on/localizatio
>>n.aspx
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "TS" <ma**********@n ospam.nospam>
Subject: Re: Resource file vs. regular Xml file
Date: Mon, 19 Nov 2007 16:42:09 -0600

steven, are resource files 1 per application or can they be split up to
have
many, say 1 per 10 pages of an application. IF so is there any reason to
do/not do this?

thanks!!! !

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:J2**** **********@TK2M SFTNGHUB02.phx. gbl...
Thanks for your followup TS,
>
If you're using .net resource model(resource file or embeded in
assembly),
then, you should not change them frequently or dynamically at runtime.
Because when .net application running, the resource items will be
loaded
>>>>into memory after it is used, just like it load the required
assemblies.
>>>>Therefore , it won't let you to flexibly update and refresh it
immediate ly
if you changed them when the application is running.
>
BTW, if you want to implement your own resource model and component,
maybe
you can havea look at the following article which introducing
extending
the
NET resource provider:
>
#Extendin g the ASP.NET 2.0 Resource-Provider Model
http://msdn2.microsoft.com/en-us/library/aa905797.aspx
>
Sincerely ,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
--------------------
>>From: "TS" <ma**********@n ospam.nospam>
>>Reference s: <OL************ **@TK2MSFTNGP03 .phx.gbl>
<eA******** ******@TK2MSFTN GP05.phx.gbl>
<uU******** ******@TK2MSFTN GP02.phx.gbl>
<ZR******** ******@TK2MSFTN GHUB02.phx.gbl>
>>Subject : Re: Resource file vs. regular Xml file
>>Date: Thu, 15 Nov 2007 08:15:57 -0600
>
>>
>>thank you.
>>
>>One concern i never asked was caching. currently i am caching my
>>custom
xml
>>files. Do resource files get cached or need caching?
>>
>>If for example my application was deployed and then we found out there
was
a
>>spellin g mistake, I imaging we could manually update the resource
>>file?
In
>>this scenario, how does caching play in?
>>
>>thanks~ !
>>
>>
>>"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
>>news:ZR** ************@TK 2MSFTNGHUB02.ph x.gbl...
>>Hi TS,
>>>
>>I think the main advantage of using .NET resource file(or resx file)
>>is
>>that you can make full use of the built-in API or coding syntax
support.
>>For example, .NET provide "ResourceManage r Class" to help you
>>programma tically load resource keys from resource file or resx file.
>>Also,
>>net resource file can be embeded into assembly. If you're using
>>custom
>>xml solution, you'll need to define your own xml file format and use
raw
>>XML API to manipulate them. How do you think?
>>>
>>Sincerely ,
>>>
>>Steven Cheng
>>>
>>Microso ft MSDN Online Support Lead
>>>
>>>
>>This posting is provided "AS IS" with no warranties, and confers no
>>rights.
>>>
>>>
>>--------------------
>>>>From: "TS" <ma**********@n ospam.nospam>
>>>>Referen ces: <OL************ **@TK2MSFTNGP03 .phx.gbl>
>><eA****** ********@TK2MSF TNGP05.phx.gbl>
>>>>Subject : Re: Resource file vs. regular Xml file
>>>>Date: Wed, 14 Nov 2007 12:00:41 -0600
>>>>
>>>>yes.
>>>>
>>>>do you know of the actual benefits of resource file instead of
regular
>>>>xml
>>>>file?
>>>>
>>>>"Duy Lam" <du**********@g mail.comwrote in message
>>>>news:eA **************@ TK2MSFTNGP05.ph x.gbl...
>>>>TS wrote:
>>>>>i have a need to possibly enable mutli language support. What
benefit
>>do
>>>>>i get by using a resource file instead of a custom xml solution?
>>>>>>
>>>>>thanks !
>>>>>
>>>>I don't know what your "customer xml solution" is ? You store all
>>>>informa tion of controls such as text, color value (#aabbcc) in a
regular
>>>>xml file, doesn't you ?
>>>>As far as I know, ASP.NET support resource file very well. So you
>>either
>>>>need a multi languages or not, you should use Resource Feature in
your
>>>>ASP.NET .
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>




Nov 21 '07 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4819
by: I Report, You Decide | last post by:
A hosting service lungcapage has banned yabb, because it takes too much CPU/memory, but phpBB is fine. Is that perl/php or the script itself? why perl sucks more resource of a server than php? i thought only mod-perl will suck not regular perl. -- I am Social Liberal-Fiscal Conservative Social Liberal: Forgiveness, Acceptance of Difference, Universal Healthcare, Free College Education for Everyone Fiscal Conservative: Small Government,...
5
18964
by: Adam Parkin | last post by:
Hello all, I am seeking some help with the following problem. I'm working on an application where I have a resource file, and in this resource file what I want to store is a list of file names (that is, essentially a string array). The potential solutions I see are: 1) Convert the string array into one big string with each element separated by some special value, store that string into the resource file's string table as a single...
7
5430
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to need to be updated with the current copy before being built. I also don't want projects being built with the old copy. Thanks! Bill
1
4026
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ==> .txt files from .resources or .resx files. ==> .resources files from text or .resx files.
5
2778
by: Daniel | last post by:
Hey guys When you hook an event (c# 2.0 syntax): myEvent += MyMethodToFire; You need to also unsubscribe it to avoid a resource leak so that the object it is in gets garbage collected like so : myEvent -= MyMethodToFire; That's all fine, but when you use visual studio to create events for objects it never creates an unsubscribing reference, so is it puting in resource leaks? Or is this being cleared somewhere that i am not seeing?
0
1931
by: =?Utf-8?B?Q29saXZpZXI=?= | last post by:
If anyone can help me with this I would really appreciate it: I have an assembly into which I have linked a manifest file as a Win32 resource. This is necessary since I want to use a class in this assembly with registration-free COM interop from a Win32 application. I also want to use this assembly with a .Net application that I want to deploy using ClickOnce. However when I try to install the application from the deployment location I get...
7
2107
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of the images that are used for icons across all of the forms in all of the assemblies in a single resource file so that swaping out an image in the resource file affects all localtions that it appears in the app. Is there a way to create a single...
0
1432
by: Sami Rehman | last post by:
Hi, I have got a C# Class library project 'MyCompany.Model.ValidationService' that deals with data validation. In this I have got a resource file 'RegularExpressions' to store regular expressions for email, tel no, SSN etc. Below is the code and associated error message Line1: ValidationResultList validationResultList = new ValidationResultList();
2
1350
by: CSharper | last post by:
I am using VS2008 C#3.0 and I would like to know if some one can help me wiith the following 2 questions; 1. I have a XML file called test.xml file in resource and I would like to how can I read the xml file wihtout extracting it to a external file? I would like to load the object into memory and use it from there. 2. I am planning to have too many data files in the resource file, is it possible to compress the resource file and then use...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.