Je fais une application pour changer la résolution de ce jeu, à la résolution demandée.C# Remplacer le caractère générique
StreamReader reader = new StreamReader(@"C:\Documents and Settings\ARTech\Bureaublad\PersistentSymbols.ini");//Reads the file.
string content = reader.ReadToEnd();//Puts the content of the file, into a variable.
reader.Close();
string replace = "persistent extern INDEX m_pixScreenWidth=(INDEX)" + txtWidth.Text + ";";
content = content.Replace("persistent extern INDEX m_pixScreenWidth=(INDEX)1920;", replace);//Replaces the ScreenWidth of the game to the requested number.
replace = "persistent extern INDEX m_pixScreenHeight=(INDEX)" + txtHeight.Text + ";";
content = content.Replace("persistent extern INDEX m_pixScreenHeight=(INDEX)1200;", replace);//Replaces the ScreenHeight of the game to the requested number.
StreamWriter writer = new StreamWriter(@"C:\Documents and Settings\ARTech\Bureaublad\PersistentSymbols.ini");
writer.Write(content);//Saves the changes.
writer.Close();
Le problème est que la résolution n'est pas toujours 1920 x 1200, donc je besoin d'une sorte de caractère générique qui accepte tout entre persistent extern INDEX m_pixScreenWidth=(INDEX)
et ;
.
En peu de temps, vous devez obtenir quelque chose comme m_pixScreenHeight = [0-9] * comme une regexp – ykatchou