ho una stringa che è args[0]
Utilizzando StreamReader per verificare se un file contiene una stringa
qui è il mio codice finora:
static void Main(string[] args)
{
string latestversion = args[0];
// create reader & open file
using (StreamReader sr = new StreamReader("C:\\Work\\list.txt"));
{
while (sr.Peek() >= 0)
{
//code here
}
}
}
Vorrei verificare se il mio file list.txt
contiene args[0]
. In tal caso, creerò un altro processo StreamWriter
per scrivere una stringa 1
nel file o scrivere 0
nel file. Come lo faccio?
Quanto è grande il file? –
la dimensione è di circa 69kb – jeremychan