Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C Sharp only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C Sharp
setting my dateTime.Today
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
=?Utf-8?B?cmF1bGF2aQ==?=
#1
setting my dateTime.Today
Jun 27 '08, 07:52 PM
vs 2008 c#
How to set my computer's date to +7 days from today's date...?
TIA
parez
#2
Jun 27 '08, 07:52 PM
Re: setting my dateTime.Today
On May 21, 11:10 am, raulavi <raul...@discus sions.microsoft .com>
wrote:
vs 2008 c#
How to set my computer's date to +7 days from today's date...?
>
TIA
you can run cmd.exe and execute date command using Process class.
Comment
Post
Cancel
=?Utf-8?B?cmF1bGF2aQ==?=
#3
Jun 27 '08, 07:52 PM
Re: setting my dateTime.Today
how would you do it in c# ?
"parez" wrote:
On May 21, 11:10 am, raulavi <raul...@discus sions.microsoft .com>
wrote:
vs 2008 c#
How to set my computer's date to +7 days from today's date...?
TIA
>
you can run cmd.exe and execute date command using Process class.
>
>
Comment
Post
Cancel
parez
#4
Jun 27 '08, 07:52 PM
Re: setting my dateTime.Today
On May 21, 11:52 am, raulavi <raul...@discus sions.microsoft .com>
wrote:
how would you do it in c# ?
>
"parez" wrote:
On May 21, 11:10 am, raulavi <raul...@discus sions.microsoft .com>
wrote:
vs 2008 c#
How to set my computer's date to +7 days from today's date...?
>
TIA
>
you can run cmd.exe and execute date command using Process class.
the following worked for me..
ProcessStartInf o startInfo = new
ProcessStartInf o("cmd.exe");
startInfo.UseSh ellExecute = false;
startInfo.Redir ectStandardInpu t = true;
startInfo.Redir ectStandardOutp ut = true;
Process process = Process.Start(s tartInfo);
string command = String.Format(" date\r\n{0}\r\n ",
DateTime.Now.Ad dDays(7).ToStri ng("MM-dd-yy"));
StreamWriter commandWriter = process.Standar dInput;
commandWriter.W riteLine(comman d);
commandWriter.F lush();
commandWriter.C lose();
process.Close() ;
Comment
Post
Cancel
=?Utf-8?B?cmF1bGF2aQ==?=
#5
Jun 27 '08, 07:52 PM
Re: setting my dateTime.Today
thank you...I will give it a try.
"parez" wrote:
On May 21, 11:52 am, raulavi <raul...@discus sions.microsoft .com>
wrote:
how would you do it in c# ?
"parez" wrote:
On May 21, 11:10 am, raulavi <raul...@discus sions.microsoft .com>
wrote:
vs 2008 c#
How to set my computer's date to +7 days from today's date...?
TIA
you can run cmd.exe and execute date command using Process class.
>
the following worked for me..
>
ProcessStartInf o startInfo = new
ProcessStartInf o("cmd.exe");
startInfo.UseSh ellExecute = false;
startInfo.Redir ectStandardInpu t = true;
startInfo.Redir ectStandardOutp ut = true;
>
Process process = Process.Start(s tartInfo);
>
string command = String.Format(" date\r\n{0}\r\n ",
DateTime.Now.Ad dDays(7).ToStri ng("MM-dd-yy"));
StreamWriter commandWriter = process.Standar dInput;
commandWriter.W riteLine(comman d);
commandWriter.F lush();
commandWriter.C lose();
process.Close() ;
>
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment