I have a text file called online.txt.
each time the program executes, it will append a new line of text. works 100%.
Now, what I am trying to acomplish, is: Everytime the program closes I want to replace _user with an empty line.
When I say empty line, I mean the line doesn't exist...
I tryed this: Doesnt work.
try
{
this.EndInvoke(this.BeginInvoke(new MethodInvoker(delegate()
{
String strxFile = File.ReadAllText("online.txt");
strxFile = strxFile.Replace(_user, null);
File.WriteAllText("online.txt", strxFile);
})));
}
catch
{ }
I tryed this too: strxFile = strxFile.Replace(_user, "");
Doesnt work... both commands above will leave the line existing, with no string in it..
The real story is, I want to delete the line 100% like the line is not there.
Thanks Guys.
VulpesPosted Jul 2, 2013, 10:04 AM
thiago costaPosted Jul 2, 2013, 11:10 AM
Now my software is 100% done thanks to you !
At work, we have a windows 2003 server work station, where all emplyees are connected to
As you probably already know, windows server 2003 allows multiple people to connect remotely to it at the same time...
So yeah, this is the local chat tool I developed, it requires no internet connectiosn, but all people remotely connect to the server can use it !!!
VulpesPosted Jul 2, 2013, 10:43 AM
However, LINQ uses 'deferred execution' which means that it doesn't actually do anything until the results of the query are enumerated. To achieve this it uses an iterator (introduced in .NET 2.0) and so the code will be equivalent to this:
thiago costaPosted Jul 2, 2013, 10:32 AM
Thank you so much, I love you !
Question... What's the difference between using LINQ, and the second example you gave me ?
Is it the same exact procedure ???
Anyways . it works 100% you resolved my problem. Thanks again <3
thiago costaPosted Jul 2, 2013, 9:46 AM
The only problem is, I am using .net framework 2.0.
.net framework 2.0 does not support LINQ right ?
VulpesPosted Jul 2, 2013, 9:18 AM