May be a little ugly but: System.DateTime dtYesterday; dtYesterday = System.DateTime.Now.AddHours(-24);
MatthewAnderson
Posts
-
How to find 24Hrs Back Time -
Cannot open file to writeFileStream fs = new FileStream(path, FileMode.Open); StreamReader sr = new StreamReader(fs); StreamWriter sw = new StreamWriter(fs); sr.ReadToEnd(); sr.Close(); sw.Close(); fs.Close();
Closing the streamreader before initializing the streamwriter causes a Stream was not writable. error. Keep the reader and writer open until you close the file. -
Cannot open file to writeTry opening the file as a filestream, and then passing the filestream handle to the streamreader and writer.
-
Showing a Control underneath another ControlA little unclear with what you are trying to do. Try using the BringToFront and SendToBack Functions if you are wanting to change the z-order of the form.
-
TextBox Methods In VC.NetThe method I use to handle this sort of event would be the keydown or one of the other key events (keypress/keyup). Just check the corresponding arguments (Such as keycode) http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx[^]