HI ALL,
I want to my application is installed in that time i want to create a txt file. Is it Possible?
I add resource in Resource in Properties & get the value from resource.
But I need to edit/replace the resource value in runtime.
if U Know the solution means can u please guide me.
Thanks & regards,
MsHema
Loading

Rajeswari nathan97 reputationPosted Sep 21, 2009, 6:12 AM EDT
rm.ResourceSetType.GetField("Key").SetValue("2");
Rajeswari nathan97 reputationPosted Sep 21, 2009, 3:28 AM EDT
using System;
using System.Resources;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Resources;
class ResourceGenerator
{
static void Main(string[] args)
{
ResXResourceWriter w = new ResXResourceWriter("ResXForm.resx");
Image i = new Bitmap("winter.jpg");
w.AddResource("myImage", i);
w.AddResource("welcomeString", "www.Mywebsite.com");
w.Generate();
w.Close();
// Make a resx reader.
ResXResourceReader r = new ResXResourceReader("ResXForm.resx");
IDictionaryEnumerator en = r.GetEnumerator();
while (en.MoveNext())
{
Console.WriteLine("Value:" + en.Value.ToString(), "Key: " + en.Key.ToString());
}
r.Close();
}
}
MEHA SHANMUGASUNDARA39 reputationPosted Sep 21, 2009, 4:01 AM EDT
Thanks for ur Reply.
I want to replace the existing value to New Value in Resource otherwise i assign.
Is it possible???
Thanx & regards,
MsHema
Rajeswari nathan97 reputationPosted Sep 21, 2009, 4:09 AM EDT
ResourceManager asd = new ResourceManager("Resource type");
asd.ResourceSetType.GetField("asds").SetValue("asdsdsd");
MEHA SHANMUGASUNDARA39 reputationPosted Sep 21, 2009, 4:34 AM EDT
String stra = rm.ResourceSetType.GetField("Key").SetValue("2");
plz reply
MEHA SHANMUGASUNDARA39 reputationPosted Sep 21, 2009, 4:46 AM EDT
Error: Object reference not set to an instance of an object.
rm.ResourceSetType.GetField("KEY").SetValue("1", "2");
Please give me a solution
Regrads,
Mshema
MEHA SHANMUGASUNDARA39 reputationPosted Sep 21, 2009, 9:03 PM EDT