首页  编辑  

模拟字符输入

Tags: /C#/界面处理/   Date Created:

SendKeys . Send( "Zswang" );

// or

using System . Runtime . InteropServices;

[ DllImport ( "user32.dll" )]

public static extern void keybd_event( byte bVk , byte bScan , uint dwFlags , uint dwExtraInfo) ;

public const uint KEYEVENTF_KEYUP = 2 ;

   keybd_event((byte) 'V' , 0 , 0 , 0 );

   keybd_event((byte) 'V' , 0 , KEYEVENTF_KEYUP, 0 );