Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
Questionupdate chart source data at runtime Pin
A M SOMAN30-Aug-07 1:28
A M SOMAN30-Aug-07 1:28 
Questionsealed class Pin
Sonia Gupta30-Aug-07 1:02
Sonia Gupta30-Aug-07 1:02 
AnswerRe: sealed class Pin
jith - iii30-Aug-07 1:28
jith - iii30-Aug-07 1:28 
GeneralRe: sealed class Pin
Sonia Gupta30-Aug-07 1:34
Sonia Gupta30-Aug-07 1:34 
GeneralRe: sealed class Pin
jith - iii30-Aug-07 1:42
jith - iii30-Aug-07 1:42 
GeneralRe: sealed class Pin
Sonia Gupta30-Aug-07 1:48
Sonia Gupta30-Aug-07 1:48 
QuestionHow to set local time by code ? Pin
nesaver8530-Aug-07 0:51
nesaver8530-Aug-07 0:51 
AnswerRe: How to set local time by code ? Pin
Martin#30-Aug-07 1:15
Martin#30-Aug-07 1:15 
Hello,

The kernel32.dll provides a method called SetLocalTime:
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct SystemTime
{
    public short sYear;
    public short sMonth;
    public short sDayOfWeek;
    public short sDay;
    public short sHour;
    public short sMinute;
    public short sSecond;
    public short sMilliSeconds;
}

[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool SetLocalTime(ref SystemTime time);


Or call the System Timesetting directly over a process:
using System.Diagnostics;
 
ProcessStartInfo TimeSetting = new ProcessStartInfo(@"C:\WINDOWS\system32\rundll32.exe","shell32.dll,Control_RunDLL timedate.cpl,,0");
TimeSetting.UseShellExecute = false;
TimeSetting.WorkingDirectory = @"C:\WINDOWS\system32";
Process TSet = Process.Start(TimeSetting);
TSet.Dispose();
TSet = null;


Hope it helps!

All the best,

Martin

AnswerRe: How to set local time by code ? Pin
PIEBALDconsult30-Aug-07 5:51
mvePIEBALDconsult30-Aug-07 5:51 
Questionmedia player Pin
Tarun.Suneja30-Aug-07 0:51
Tarun.Suneja30-Aug-07 0:51 
AnswerRe: media player Pin
Dave Kreskowiak30-Aug-07 6:31
mveDave Kreskowiak30-Aug-07 6:31 
QuestionContent Alignment Pin
Stevo Z30-Aug-07 0:42
Stevo Z30-Aug-07 0:42 
AnswerRe: Content Alignment Pin
Martin#30-Aug-07 1:18
Martin#30-Aug-07 1:18 
GeneralRe: Content Alignment Pin
Stevo Z30-Aug-07 1:25
Stevo Z30-Aug-07 1:25 
QuestionInstant Messenger Pin
fyzkhan30-Aug-07 0:25
fyzkhan30-Aug-07 0:25 
AnswerRe: Instant Messenger Pin
jith - iii30-Aug-07 1:32
jith - iii30-Aug-07 1:32 
Questionclass diagram Pin
Sonia Gupta30-Aug-07 0:13
Sonia Gupta30-Aug-07 0:13 
AnswerRe: class diagram Pin
gauthee30-Aug-07 0:47
gauthee30-Aug-07 0:47 
QuestionSome Sources! Pin
mrkeivan29-Aug-07 23:16
mrkeivan29-Aug-07 23:16 
AnswerRe: Some Sources! Pin
Developer61129-Aug-07 23:24
Developer61129-Aug-07 23:24 
AnswerRe: Some Sources! Pin
Michael Sync29-Aug-07 23:37
Michael Sync29-Aug-07 23:37 
GeneralRe: Some Sources! Pin
mrkeivan29-Aug-07 23:55
mrkeivan29-Aug-07 23:55 
GeneralRe: Some Sources! Pin
Michael Sync30-Aug-07 0:10
Michael Sync30-Aug-07 0:10 
QuestionUrgent Please Help me Pin
Cape Town Developer29-Aug-07 22:46
Cape Town Developer29-Aug-07 22:46 
AnswerRe: Urgent Please Help me Pin
Michael Sync29-Aug-07 23:32
Michael Sync29-Aug-07 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.