我做的一个项目要用到后台监视功能.
即做一个后台运行的程序,监视浏览器的标题,
如果浏览器打开的页面标题与预先设定的标题相同,
就记录下来他的键盘操作记录,并根据记录给出提示.好像要用到api,没有高过,在网上搜了下也没有找到合适的代码(写的很乱.没有看懂)请高手给出完整的代码实例,谢谢.
即做一个后台运行的程序,监视浏览器的标题,
如果浏览器打开的页面标题与预先设定的标题相同,
就记录下来他的键盘操作记录,并根据记录给出提示.好像要用到api,没有高过,在网上搜了下也没有找到合适的代码(写的很乱.没有看懂)请高手给出完整的代码实例,谢谢.
解决方案 »
- 【求助】c# winform程序打包后配置文件如何更改?
- 冰天雪地 裸体360度跪求 [ascx自定义控件的一个问题]
- Update 无法找到 TableMapping['TB_ADMIN'] 或 DataTable“TB_ADMIN”。
- C#有没有办法写像WIN32一样的API?
- 困惑:找不到RTF的操作类
- sql查询
- winform的DataGrid如何实现多表头?
- winform Label上如何换张图片?
- 帮忙?
- 求一开源 C# CMS
- C#程序里怎样写EXCEL。(其中包括控制EXCEL单元格的大小,及合并单元格,最难的是怎样设置条形码)
- 在C#的MDI应用程序中,如何判断某个子窗口是否被激活
using System.Windows.Forms;
using System.Runtime.InteropServices;
using SHDocVw;
//引用SHDocVw.dll
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ShellWindowsClass shellWindows = new ShellWindowsClass();
foreach (InternetExplorer ie in shellWindows)
{
string filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower(); if (filename.Equals("iexplore"))
{
Console.WriteLine(ie.LocationName);
}
}
} }
}
如果是的话,net中已经有header这个对象了亚
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;namespace bindingtest
{
public partial class Form1 : Form
{
Timer timer = new Timer();
public Form1()
{
InitializeComponent(); timer.Interval = 1000; timer.Tick += new EventHandler(timer_Tick); timer.Start();
} void timer_Tick(object sender, EventArgs e)
{
string wintitle = "预设的标题";
MonitorWindow(wintitle);
} void MonitorWindow(string titile)
{
Process[] procs = Process.GetProcesses("iexplore"); foreach (Process ele in procs)
{
if (ele.MainWindowTitle.Equals(titile))
{
MessageBox.Show(titile + " find!");
}
}
}
}
}
你说得代码我在2005测试没有通过,错误行:using SHDocVw;
错误提示如下:
错误 1 找不到类型或命名空间名称“SHDocVw”(是否缺少 using 指令或程序集引用?) D:\我的文档\Visual Studio 2005\Projects\TEST01\TEST01\Form2.cs 9 7 TEST01回6楼:
你得代码我在2005下也没有通过,错误行:Process[] procs = Process.GetProcesses("IEXPLORE");
错误提示:
无法连接到远程计算机。
Process[] procs = Process.GetProcesses("iexplore",Environment.MachineName);
然后,得到进程数,判断进程名,得到当前进程名的窗体名 --> 判断即可