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 nathanPosted Sep 21, 2009, 10:12 AM
rm.ResourceSetType.GetField("Key").SetValue("2");
MEHA SHANMUGASUNDARAPosted Sep 22, 2009, 1:03 AM
MEHA SHANMUGASUNDARAPosted Sep 21, 2009, 8:46 AM
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 SHANMUGASUNDARAPosted Sep 21, 2009, 8:34 AM
String stra = rm.ResourceSetType.GetField("Key").SetValue("2");
plz reply
Rajeswari nathanPosted Sep 21, 2009, 8:09 AM
ResourceManager asd = new ResourceManager("Resource type");
asd.ResourceSetType.GetField("asds").SetValue("asdsdsd");
MEHA SHANMUGASUNDARAPosted Sep 21, 2009, 8:01 AM
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 nathanPosted Sep 21, 2009, 7:28 AM
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();
}
}