473,372 Members | 991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

"string resource file" in c#?

Hello,
What is the equivalent "string resource file" in c#?

And, is there a way to create a beep in C#?

Thanks,
Dan
Nov 15 '05 #1
7 6879
100
Hi Dan,
What is the equivalent "string resource file" in c#?
I don't think there is equivalent of string resource since you can embed
whatever stream you want into a assembly. My suggestion is to use XML file
for keeping the strings. If you need language specific versions of the
strings you can use satellite assemblies, which will contain different
versions of that xml file.
And, is there a way to create a beep in C#?

There is no class in the current vesrion of the framework providing this.
You have to use P\Invike to call MessageBeep or whatever other API function
you want. If search the net I believe there are tons of examples how to do
beeps.

HTH
B\rgds
100
Nov 15 '05 #2
Hi Dan,

If your purpose is internationalization and localization, with .NET,
Microsoft (finally) provides truely excellent support. (Even if you want a
string resource for some other reason, these features will do the trick for
you.) Take a look at the Localizable property on the Form properties
window. Turn it on and all form and control properties will be stored in a
separate resources file. Take a look at the InitializeComponent() code to
see how it works. In addition, Microsoft provides a WinRes.exe resource
editor that lets localizers edit these properties without having access to
the code. Since the resource is an XML file (e.g. Form1.resx file) you can
use any XML editor to modify its contents if you'd like.

In addition, .NET supports the creation of multiple resource files using a
hierarchical model. There is a basic invarient resource, then ones that are
language specific, then ones that are dialect specific and so forth. All of
this is supported in the default Form, so you can explore these features in
the Form properties. For example, try setting the Language to French and
see what happens.

Tom Clement
Apptero, Inc.

"Dan H." <Da********@NO.comcast.SsPpAaMm.net> wrote in message
news:uU**************@TK2MSFTNGP10.phx.gbl...
Hello,
What is the equivalent "string resource file" in c#?

And, is there a way to create a beep in C#?

Thanks,
Dan

Nov 15 '05 #3
> What is the equivalent "string resource file" in c#?
Yes.
The .NET string resource file looks like the Java properties
(id=string), but the encoding uses UTF8 instead of Java escape.

The extension is .txt (I think a bad idea), and can be compiled
with ResGen to a .resources file
You can also use .resx files (xml format)
ResGen is able to convert between .resx, .txt and .resources
(but if the resx contain forms, images, etc, it will drop them)

Mihai
Nov 15 '05 #4

"Dan H." <Da********@NO.comcast.SsPpAaMm.net> 在郵件
news:uU**************@TK2MSFTNGP10.phx.gbl 中撰寫...
Hello,
What is the equivalent "string resource file" in c#?

If the purpose is for Localization, simply set your form's Localizable
property to true and then change the Language property to whatever language
you want and start changing the control's text. The locailization
information will be stored in the language specific resx files.
And, is there a way to create a beep in C#?

Include the following in your class file to 'Beep'

[System.Runtime.InteropServices.DllImport("user32.d ll")]
public static extern int MessageBeep(uint n);
Thanks,
Dan

Nov 15 '05 #5
Joe
Is any of this possible (reasonably easily :-)) without VS.Net? I am
using SharpDevelop 0.98 (free VS.Net lookalike), and trying to get
something working similar to what is in VS.Net. Ya, I know, just buy
VS.Net :-) But I am cheap.

It seems like what I need is basically a resource editor that
generates .resx files (including stuff like size of Dialog boxes,
etc), but am still naive about how all this resource stuff works.

Any one have any experience with this?

Thanks,

Joe

"Terence Lee" <tc****@netvigator.com> wrote in message news:<ef*************@tk2msftngp13.phx.gbl>...
"Dan H." <Da********@NO.comcast.SsPpAaMm.net> 在郵件
news:uU**************@TK2MSFTNGP10.phx.gbl 中撰寫...
Hello,
What is the equivalent "string resource file" in c#?


If the purpose is for Localization, simply set your form's Localizable
property to true and then change the Language property to whatever language
you want and start changing the control's text. The locailization
information will be stored in the language specific resx files.

Nov 15 '05 #6
Joe
Is any of this possible (reasonably easily :-)) without VS.Net? I am
using SharpDevelop 0.98 (free VS.Net lookalike), and trying to get
something working similar to what is in VS.Net. Ya, I know, just buy
VS.Net :-) But I am cheap.

It seems like what I need is basically a resource editor that
generates .resx files (including stuff like size of Dialog boxes,
etc), but am still naive about how all this resource stuff works.

Any one have any experience with this?

Thanks,

Joe

"Terence Lee" <tc****@netvigator.com> wrote in message news:<ef*************@tk2msftngp13.phx.gbl>...
"Dan H." <Da********@NO.comcast.SsPpAaMm.net> 在郵件
news:uU**************@TK2MSFTNGP10.phx.gbl 中撰寫...
Hello,
What is the equivalent "string resource file" in c#?


If the purpose is for Localization, simply set your form's Localizable
property to true and then change the Language property to whatever language
you want and start changing the control's text. The locailization
information will be stored in the language specific resx files.

Nov 15 '05 #7
SharpDevelop makes the full framework available to you.

To generate .resx files, use code something like this:

ResXResourceWriter rw = new
ResXResourceWriter(@"C:\myFullPathAndFileName + ".resx");
rw.AddResource("Key", value);
//add more key/value pairs, etc.
rw.Generate();
rw.Close();

you need a using statement like:
using System.Resources;

and you need to ref the WinForms DLL
"Joe" <jw******@hotmail.com> wrote in message
news:6f**************************@posting.google.c om...
Is any of this possible (reasonably easily :-)) without VS.Net? I am
using SharpDevelop 0.98 (free VS.Net lookalike), and trying to get
something working similar to what is in VS.Net. Ya, I know, just buy
VS.Net :-) But I am cheap.

It seems like what I need is basically a resource editor that
generates .resx files (including stuff like size of Dialog boxes,
etc), but am still naive about how all this resource stuff works.

Any one have any experience with this?

Thanks,

Joe

"Terence Lee" <tc****@netvigator.com> wrote in message

news:<ef*************@tk2msftngp13.phx.gbl>...
"Dan H." <Da********@NO.comcast.SsPpAaMm.net> 在郵件
news:uU**************@TK2MSFTNGP10.phx.gbl 中撰寫...
Hello,
What is the equivalent "string resource file" in c#?


If the purpose is for Localization, simply set your form's Localizable
property to true and then change the Language property to whatever language you want and start changing the control's text. The locailization
information will be stored in the language specific resx files.

Nov 15 '05 #8

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

Similar topics

1
by: John Pastrovick | last post by:
Is there a way to load an image locally (in the client) when a selection of a file is made using input type=file. The purpose is to allow selection of a file and put the image in the browser...
2
by: srktnc | last post by:
When I run the program, I get a Debug Error saying "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more...
0
by: bleedledeep | last post by:
I have 3 C# applications that run as a group. If I run each of these applications individually, they all start fine. If I have a batch file that starts each of them quickly, on *most* machines...
1
by: Shark Bait | last post by:
Hi, I have a web site that I am creating locally on my workstation's "C" drive. I have a reference in my web.config to a resource file (it contains global keys) using "\" as the root. Everything...
0
by: yma | last post by:
Hi, I have a web.config file that contains <httpHandlers> section that causes "cannot load file..." error. If I delete this section, it is OK. Why did vb.net add this section? It does not add...
4
by: Newsgroups | last post by:
Does anyone know what the VB.NET equivalent to the VB 6.0 String Function is?
2
by: mark | last post by:
How do I detect that a particular form element is a file upload or if the file upload has worked? In the Python cgi module documentation I found suggested code... form = cgi.FieldStorage()...
2
by: babakandme | last post by:
Hi to every body...:D I'm a novice C++ programmer & I've a question, How can I write a class as follow to a file... Class A { public: // Accessors Methods...
4
by: mpatharkar | last post by:
Hi all, I wrote a script to search a pattern in input file and if pattern does not found in input file ,print that pattern in to output file. The input file is...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.