Hello,
What is the equivalent "string resource file" in c#?
And, is there a way to create a beep in C#?
Thanks,
Dan 7 6925
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
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
> 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
"Dan H." <Da********@NO. comcast.SsPpAaM m.net> ¦b¶l¥ó
news:uU******** ******@TK2MSFTN GP10.phx.gbl ¤¤¼¶¼g... 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
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> ¦b¶l¥ó news:uU******** ******@TK2MSFTN GP10.phx.gbl ¤¤¼¶¼g... 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.
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> ¦b¶l¥ó news:uU******** ******@TK2MSFTN GP10.phx.gbl ¤¤¼¶¼g... 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.
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> ¦b¶l¥ó news:uU******** ******@TK2MSFTN GP10.phx.gbl ¤¤¼¶¼g... 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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.
|
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:
|
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...
|
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
| |
by: Newsgroups |
last post by:
Does anyone know what the VB.NET equivalent to the VB 6.0 String Function
is?
|
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
|
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...
|
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»All the flowers of tomorrow are in the seeds of today.
2000-1209»I saw this article posted on another site and wanted to share it with everyone at TSDN. Please read this article and post your thoughts....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |