
Untitled
By: a guest on
Jul 22nd, 2012 | syntax:
None | size: 1.06 KB | hits: 6 | expires: Never
How to write a string in a resource file?
StreamReader reader = new StreamReader(Auctions_Parser.Properties.Resources.Settings);
string content = reader.ReadToEnd();
reader.Close();
string ebay = "";
if (checkBox1.Checked){ ebay = "1"; } else { ebay = "0"; }
content = Regex.Replace(content, @"Ebay&d", "Ebay&"+ebay);
StreamWriter writer = new StreamWriter(Auctions_Parser.Properties.Resources.Settings);
writer.Write(content);
writer.Close();
SaveFolder&C:/Desktop/
Ebay&1
Delcampe&1
BidStart&1
eBid&1
Proxy&0
OpenFolder&0
TurnOff&0
using System.Resources;
// Creates a resource writer.
IResourceWriter writer = new ResourceWriter("myResources.resources");
// Adds resources to the resource writer.
writer.AddResource("String 1", "First String");
writer.AddResource("String 2", "Second String");
writer.AddResource("String 3", "Third String");
// Writes the resources to the file or stream, and closes it.
writer.Close();