📄 callingvariations.cs
字号:
using System;
using System.Runtime.InteropServices;
// This class encapsulates the calling variations of the function Beep
public class CallingVariations
{
// Declare version
[DllImport("kernel32.dll", EntryPoint="Beep")]
public static extern int DeclareBeep(int dwFreq, int dwDuration);
// DLLImport version
[DllImport("kernel32.dll", EntryPoint="Beep")]
public static extern int DLLImportBeep(int dwFreq, int dwDuration);
// Specifying Unicode
[DllImport( "Kernel32.dll", EntryPoint="Beep", CharSet=CharSet.Unicode )]
public static extern int UnicodeBeep(int dwFreq, int dwDuration);
// Specifying Ansi
[DllImport( "Kernel32.dll", EntryPoint="Beep", CharSet=CharSet.Ansi )]
public static extern int ANSIBeep(int dwFreq, int dwDuration);
// Specifying Auto
[DllImport( "Kernel32.dll", EntryPoint="Beep", CharSet=CharSet.Auto )]
public static extern int AutoBeep(int dwFreq, int dwDuration);
// Using Exact Spelling
// Default is FALSE
// if FALSE an A is appended under ANSI and a W under Unicode so MessageBox becomes
// MessageBoxW
[DllImport("kernel32.dll", EntryPoint="Beep", ExactSpelling=true, CharSet=CharSet.Ansi)]
public static extern int ExactSpellingBeep(int dwFreq, int dwDuration);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -