Need To Create Simple C# Windows App – Looks In Folder and Processes New Files Added [duplicate]

According to this question: FileSystemWatcher vs polling to watch for file changes it is mostly a problem of the InternalBufferSize try to push that value a little up. But there are also some situations, where even that won’t work e.g. network shares. The alternative would be polling as said in the other question, which means … Read more

Opening a text file is passed as a command line parameter [closed]

A starting point. Then what you want to do with the contents of the file is up to you using System.IO; // <- required for File and StreamReader classes static void Main(string[] args) { if(args != null && args.Length > 0) { if(File.Exists(args[0])) { using(StreamReader sr = new StreamReader(args[0])) { string line = sr.ReadLine(); …….. … Read more

Use of string as an existing variable in c#

You cannot do it for local variables like this. For member fields you can use reflection; for locals, the simplest approach is to use Dictionary, for example, like this: IDictionary<string,string> vars = new Dictionary<string,string> { {“one”, “find”} , {“two”, “cancel”} }; combobox1.text = vars[“one”];