仅转换1行代码. VB.net至C#.net [英] Convert just 1 line code. VB.net to C#.net
问题描述
我当时在vb.net中编写了一个程序,但由于种种原因,我现在将整个项目移至了csharp.
我自己一行一行地转换代码,并在此处停止-
我想把键盘键放下来.我在vb.net上执行这些操作.
MyProject.Computer.Keyboard.CtrlKeyDown = ...
MyProject.Computer.Keyboard.AltKeyDown = ...
MyProject.Computer.Keyboard.ShiftKeyDown = ...
还有更多等等...
如何在C#.net上编写这些代码?
I was write a program in vb.net but I now moved my whole project to csharp because of many reason.
I converts my codes line by line myself and get stopped on here -
I want get get keyboard key down. I do these on vb.net.
MyProject.Computer.Keyboard.CtrlKeyDown =...
MyProject.Computer.Keyboard.AltKeyDown=...
MyProject.Computer.Keyboard.ShiftKeyDown=...
and many more etc ...
How to I write these codes on C#.net ?
Thanks in advanced!
推荐答案
您可以通过下面的链接在线从C#转换为VB.NET,从VB.NET转换为C#. http://converter.telerik.com/ [ ^ ]
希望这对您有帮助
You can convert from C# to VB.NET and VB.NET to C# through online from the below link
http://converter.telerik.com/[^]
Hope this helps
例如:
检测是否按下了Shift键:
E.G.:
Detect if the shift key is pressed:
if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
一般信息:
命名空间: System.Windows.Forms
程序集: System.Windows.Forms(在System.Windows.Forms.dll中)
干杯,
Edo
General Info:
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Cheers,
Edo
除了从C#到VB.NET的在线翻译,还有一种基于开源产品的非常全面的离线方法,这是非常好的: ILSpy.
请查看我过去的答案:
从C#到VB.NET的COde线解释 [ ^ ],
需要将vb代码转换为c# [ FixedPage to ContentPage将c#代码转换为vb.net [
In addition to on-line translator from C# to VB.NET and back, there is a really comprehensive off-line approach, based on an open-source product, very good one: ILSpy.
Please see my past answers:
COde Line Interpretatio of C# to VB.NET[^],
Need to convert vb code to c#[^],
FixedPage to ContentPage convert c# code into vb.net[^].
—SA
这篇关于仅转换1行代码. VB.net至C#.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!