「%」と「;」を押すことをエミュレートする方法 キー
string a2 = ";:%1467";
byte[] bb = Encoding.ASCII.GetBytes(a2);
foreach (byte b in bb)
{
InputWorkflow.SendKeyPress((ushort)b);
}
入力ワークフロー: http://pastebin.com/e9Hg24kD
「%」と「;」を押すことをエミュレートする方法 キー
string a2 = ";:%1467";
byte[] bb = Encoding.ASCII.GetBytes(a2);
foreach (byte b in bb)
{
InputWorkflow.SendKeyPress((ushort)b);
}
入力ワークフロー: http://pastebin.com/e9Hg24kD
You are misusing the method described in that class; also you have to pass keyboard scan code to the InputWorkFlow.SendKeyPress(ushort keycode);
method. It doesn't accept ascii bytes.
Use the SendKeys
class it works the way you want:
string a2 = ";:%1467";
byte[] bb = Encoding.ASCII.GetBytes(a2);
foreach (byte b in bb)
{
SendKeys.Send(b);
}
If you need to wait for each key to be processed then use SendWait instead of Send
foreach (byte b in bb)
{
SendKeys.SendWait(b);
}
Starting from .NET 3.0 on Windows Vista onwards you need to add the following in your app.config:
<appSettings>
<add key="SendKeys" value="SendInput"/>
</appSettings>