创建.net应用程序以进行后台工作 [英] create .net application for background working

查看:77
本文介绍了创建.net应用程序以进行后台工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


朋友
我打算准备1个.net应用程序以使工作自动化

当我们运行应用程序时,必须将其最小化并开始工作..
应该发生的是-
它应该打开用于ex-Internet浏览的指定软件,然后必须将单词粘贴到以前指定的位置(例如,在网址栏中输入www.Facebook.com),然后输入
就这样
请为鼠标和键盘工作事件指定一些链接或示例代码....
在此先感谢:)

问候,
肉山


hi friends
i am planning to prepare 1 .net application to automate the work
i.e
When we run our application it must be minimized and work should start..
What should happen is--
it should open specified software for ex - internet explore and then it must paste the word in previously specifed position(ex typing www.Facebook.com in url bar) then enter
that''s it
Plz specify some links or sample codes for mouse and keyboard working events....
Thanks in advance :)

with regards,
Roshan

推荐答案

似乎可以使用 Interaction 类和"shell"函数

VB.NET演示代码
It is seems like you can use the class Interaction and the function of "shell"

VB.NET DEMO CODE
Dim procID As Integer
        ' Run I.E.
        procID = Shell("the path of your exe file", AppWinStyle.NormalFocus)



您可以在exe文件的字符串后添加一个空白的URL,例如:
.. \ iexplorer.exe www.facebook.com

AppWinStyle是包含此类样式的枚举类型



you can add the url after the string of you exe file with a blank for example:
..\iexplorer.exe www.facebook.com

the AppWinStyle is a enum type include such styles

 AppWinStyle.Hide

 AppWinStyle.NormalFocus

 AppWinStyle.MinimizedFocus

 AppWinStyle.MaximizedFocus

 AppWinStyle.NormalNoFocus

 AppWinStyle.MinimizedNoFocus



返回值是存在的exe文件的进程ID.



the return value is the process ID of exist exe file.


是的,您可以使用Windows应用程序或ConsoleApplication来实现此目的.

尝试使用System.Diagnostics的This Add name Space;首先尝试使用控制台应用程序
1)如果您愿意,可以设置日期和时间以自动执行此操作.

使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用System.Text;
使用System.Diagnostics;

命名空间ConsoleApplication2
{
课程计划
{
静态void Main(string [] args)
{

main();
}

公共静态void main()
{
Process.Start("iexplore.exe","http://www.google.com");

}

}
}
Yes Man U can Achieve this By Using Windows Application or ConsoleApplication

try This Add name Space using System.Diagnostics; Try with Console Application First
1)If you Want You Can Set date And Time So as to perform This Happen Automatically .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{

main();
}

public static void main()
{
Process.Start("iexplore.exe", "http://www.google.com");

}

}
}


这篇关于创建.net应用程序以进行后台工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆