473,396 Members | 2,033 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,396 software developers and data experts.

Resource File in console application

Hi I am a newbie and i am trying to create a resource file (resx) for a
console C# application
Can i go to current C# project and add a new resource file and then
start adding values?

Can anyone please show a sample console application having a resource
file added like this.

Help would be appreciated

Regards
JK

Sep 28 '06 #1
2 12564

gopal wrote:
Hi I am a newbie and i am trying to create a resource file (resx) for a
console C# application
Can i go to current C# project and add a new resource file and then
start adding values?

Can anyone please show a sample console application having a resource
file added like this.

Help would be appreciated

Regards
JK
Add a resource file via Project -Add New Item -Assembly Resource
File

Add items to your resource file.

Example code to get a resource with a "name" of "Res1" from a resource
file:

using System;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
System.Resources.ResourceManager rm = new
System.Resources.ResourceManager ("ConsoleApplication1.Resource1",
System.Reflection.Assembly.GetExecutingAssembly()) ;
Console.WriteLine (rm.GetString ("Res1"));
Console.ReadLine ();
}
}
}

Sep 28 '06 #2

gopal wrote:
Hi I am a newbie and i am trying to create a resource file (resx) for a
console C# application
Can i go to current C# project and add a new resource file and then
start adding values?

Can anyone please show a sample console application having a resource
file added like this.

Help would be appreciated

Regards
JK
Add a resource file via Project -Add New Item -Assembly Resource
File

Add items to your resource file.

Example code to get a resource with a "name" of "Res1" from a resource
file:

using System;

namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
System.Resources.ResourceManager rm = new
System.Resources.ResourceManager ("ConsoleApplication1.Resource1",
System.Reflection.Assembly.GetExecutingAssembly()) ;
Console.WriteLine (rm.GetString ("Res1"));
Console.ReadLine ();
}
}
}

best

Nick
http://seecharp.blogspot.com/

Sep 28 '06 #3

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

Similar topics

11
by: Alan T | last post by:
I added a resource file into my project, to store the caption of buttons and labels.. How do I make use of this resource file to dynamically assign to the buttons and labels ?
0
by: GT | last post by:
This question has been posted before, but without any response so therefore I'm trying once more. I'm trying to embed .resource files into a Windows application in VS2005, and then compile and...
2
by: gopal | last post by:
Hi I am a newbie and i am trying to create a resource file (resx) for a console C# application Can i go to current C# project and add a new resource file and then start adding values? Can...
0
by: gopal | last post by:
Hi, I want to create a reosource for use in my console application. I tried creating a new reosurce file from Assembly Resource File - new Item in my C# console project. When i run the...
0
by: gopal | last post by:
Hi, I had an issue with loading/using resource file. I thought i will share this information if it helpful some . I have a console C# application and inside this i have class definition as...
12
by: TS | last post by:
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!
4
by: federico | last post by:
Hello, I am trying to setup a Visual Basic "Console" application for searching Outlook folders. To this end I am trying to implement a Handler for the Outlook.Application.AdvancedSearchComplete...
1
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I am experimenting with a concept the engineers want. I want to create an app that runs in the console. When an event happens, I want to display an image. Can I do this without having a form?...
2
by: pankajprakash | last post by:
Hi All, I have a asp.net web service and I am running an .exe file though this web service. The web serivce is calling that .exe file (console application) and running the code of that console...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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,...
0
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...
0
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...

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.