473,857 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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 6929
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 internationaliz ation 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 InitializeCompo nent() 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.SsPpAaM m.net> wrote in message
news:uU******** ******@TK2MSFTN GP10.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.SsPpAaM m.net> 在郵件
news:uU******** ******@TK2MSFTN GP10.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("use r32.dll")]
public static extern int MessageBeep(uin t 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****@netviga tor.com> wrote in message news:<ef******* ******@tk2msftn gp13.phx.gbl>.. .
"Dan H." <Da********@NO. comcast.SsPpAaM m.net> 在郵件
news:uU******** ******@TK2MSFTN GP10.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****@netviga tor.com> wrote in message news:<ef******* ******@tk2msftn gp13.phx.gbl>.. .
"Dan H." <Da********@NO. comcast.SsPpAaM m.net> 在郵件
news:uU******** ******@TK2MSFTN GP10.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:

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

you need a using statement like:
using System.Resource s;

and you need to ref the WinForms DLL
"Joe" <jw******@hotma il.com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
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****@netviga tor.com> wrote in message

news:<ef******* ******@tk2msftn gp13.phx.gbl>.. .
"Dan H." <Da********@NO. comcast.SsPpAaM m.net> 在郵件
news:uU******** ******@TK2MSFTN GP10.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
9133
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 without loading the reloading the page. I thought about 1. putting a function call in the onchange event of the html input
2
2580
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 information." I put a cout statement (//cout << "len of cPtr: " << _len << endl; ) in my constructor and see that _len is 3435973837 though my character pointer has only a few characters. Then I get the usual message as state above.
0
1516
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 all three run fine. BUT! On some older/slower machines (really not all that old or slow and that are configured identically to the newer/faster machines), when I start all 3 with the batch file, one of them will not start and a popup containing:
1
2857
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 works fine. When I move it to a test server the mapping to the file no longer works unless I include the drive letter "D". I don't have to reference the drive letter on my workstation why would I have to do it on test? I thought "\" meant: "The root...
0
1728
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 this section now. Thank you. <!-- PREVENT SOURCE CODE DOWNLOAD This section sets the types of files that will not be downloaded. As well as entering a httphandler for a file type, you must also associate that file
4
47584
by: Newsgroups | last post by:
Does anyone know what the VB.NET equivalent to the VB 6.0 String Function is?
2
3443
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() fileitem = form if fileitem.file: # It's an uploaded file; count lines
2
1670
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
1922
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 -------------------------------------------------------- 1999-1011翠ll the flowers of tomorrow are in the seeds of today. 2000-1209膏 saw this article posted on another site and wanted to share it with everyone at TSDN. Please read this article and post your thoughts....
0
9767
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
10711
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...
1
10807
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10394
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9549
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 projectplanning, coding, testing, and deploymentwithout 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...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5774
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...
0
5967
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3215
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.