zoukankan      html  css  js  c++  java
  • 取得屏幕刷新率


    using System;
    using System.Runtime.InteropServices;


    namespace ConsoleApplication
    {

    public sealed class EntryPoint
    {
    private EntryPoint(){}

    [DllImport(
    "Gdi32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
    public static extern int GetDeviceCaps(IntPtr hDC,int nIndex);

    /// <summary>
    /// 获得屏幕刷新率
    /// </summary>

    public static int RefreshRate
    {
    get
    {
    IntPtr desktopDC 
    = GetDC(GetDesktopWindow());
    return GetDeviceCaps(desktopDC,116);
    }

    }


    [DllImport(
    "User32.dll")] 
    public extern static IntPtr GetDesktopWindow();  

    [DllImport(
    "User32.dll")]
    public static extern IntPtr GetDC(IntPtr hWnd);

    static void Main()
    {
    Console.WriteLine(
    "屏幕刷新率为: {0}Hz",RefreshRate);
    Console.ReadLine();
    }

    }

    }

  • 相关阅读:
    ftp服务器架设
    samba服务器架设
    apache安装
    yum及prm安装
    redis安装与使用
    memcached安装与使用
    mysql主从服务器
    nginx负载均衡服务器搭建
    lnmp环境搭建
    linux笔记
  • 原文地址:https://www.cnblogs.com/wy/p/209712.html
Copyright © 2011-2022 走看看