Horje
c#, get a embedded resx file Code Example
c#, get a embedded resx file
private void button1_Click(object sender, EventArgs e)
{
    StringCollection strValuesToSearch = new StringCollection();
    strValuesToSearch.Add("Apple");
    string stringToReplace;
    stringToReplace = textBox1.Text;

    StreamReader FileReader = new StreamReader(@"C:\MyFile.txt");
    string FileContents;
    FileContents = FileReader.ReadToEnd();
    FileReader.Close();
    foreach (string s in strValuesToSearch)
    {
        if (FileContents.Contains(s))
            FileContents = FileContents.Replace(s, stringToReplace);
    }
    StreamWriter FileWriter = new StreamWriter(@"MyFile.txt");
    FileWriter.Write(FileContents);
    FileWriter.Close();
}




Csharp

Related
delete all connections rabbitmq terminal Code Example delete all connections rabbitmq terminal Code Example
convert date to days c# Code Example convert date to days c# Code Example
get c directory contains system windows c# Code Example get c directory contains system windows c# Code Example
how to detect ajax request in asp.net core Code Example how to detect ajax request in asp.net core Code Example
reverse a linked list C# Code Example reverse a linked list C# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8