class1.cs

来自「修改系统时间 修改系统时间 修改系统时间 修改系统时间」· CS 代码 · 共 69 行

CS
69 行
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace ConsoleApplication2
{
    public struct SYSTEMTIME
    {

        public ushort wYear;

        public ushort wMonth;

        public ushort wDayOfWeek;

        public ushort wDay;

        public ushort wHour;

        public ushort wMinute;

        public ushort wSecond;

        public ushort wMilliseconds;

        public void SetTime()
        {
            wYear = 2007;

            wMonth = 8;

            wDayOfWeek = 3;

            wDay = 8;

            wHour = 0;

            wMinute = 0;

            wSecond = 0;

            wMilliseconds = 0;
        }
    }
    public class Win32API

    {

        [DllImport("Kernel32.dll")]

        public static extern bool SetLocalTime(ref SYSTEMTIME Time );

        [DllImport("Kernel32.dll")]

        public static extern void GetLocalTime(ref SYSTEMTIME Time);

    }




        


    

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?