c# Console application Open/Get Url by Browser
C# url 用 浏览器打开、C#获取浏览器的url
static void Main(string[] args)
{
string file = @"C:\Users\Hero\Desktop\SiteWhitelist.tsv";
string[] lines = System.IO.File.ReadAllLines(file);
foreach (var url in lines)
{ var startInfo = new ProcessStartInfo("firefox.exe", url);
Process.Start(startInfo);
string getUrl = GetBrowserURL("FireFox");
Thread.Sleep();
File.WriteAllText(@"C:\Users\Hero\Desktop\SaveSiteWhitelist.txt",
getUrl + Environment.NewLine + File.ReadAllTex (@"C:\Users\Hero\Desktop\SaveSiteWhitelist.txt"));
}
Console.ReadKey();
}
public static string GetBrowserURL(string browser)
{
try
{
DdeClient dde = new DdeClient(browser, "WWW_GetWindowInfo");
dde.Connect();
string url = dde.Request("URL", int.MaxValue);
string[] text = url.Split(new string[] { "\",\"" }, StringSplitOptions.RemoveEmptyEntries);
dde.Disconnect();
return text[].Substring();
}
catch
{
return null;
}
}
c# Console application Open/Get Url by Browser的更多相关文章
- win32 console application 如何修改图标?
win32 console application ,不要看这名字高端大气上档次,让你摸不着头脑,其实他就是我们最先学习c语言那种黑色窗口的东西......话说他怎么修改图标呢?第一种方法是:右键-〉 ...
- RESTful Console Application
RESTful Console Application Introduction Inspirited by RESTFul architecture, A console application t ...
- 如何将Console application的Program函数变成支持async的?
如何将Console application的Program函数变成支持async的? class Program { static void Main(string[] args) { Task ...
- Hello World 之 控制台版本(Console Application)
原文:Hello World 之 控制台版本(Console Application) 先来介绍下Hello, World "Hello, World"程序指的是只在计算机屏幕 ...
- Using Spring.net in console application
Download Spring.net in http://www.springframework.net/ Install Spring.NET.exe Create a console appli ...
- Fix Visual Studio 2013 Razor CSHTML Intellisense in Class Library or Console Application
https://mhusseini.wordpress.com/2015/02/05/fix-visual-studio-2013-razor-cshtml-intellisense-in-class ...
- C# 控制台程序(Console Application )启动后隐藏
背景 前段时间给项目编写了数据适配器,读取其他系统的数据后推送到MQ上,我们的系统通过订阅MQ的方式来获取.由于其他系统支持C#编程,且为了一时方便,选择了C#的控制台程序. 最近用户在使用中,总是不 ...
- .NET 如何隐藏Console Application的窗口
1)创建Console Application工程 2)修改Output type 为Windows Application即可
- VS2015 create a C++ console application based on WinRT
1. Enable /ZW 2. Disable /Gm 3. #using C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcpack ...
随机推荐
- zepto 源码 $.contains 学习笔记
$.contains(parent,node) 返回值为一个布尔值 ==> boolean parent,node我们需要检查的节点检查父节点是否包含给定的dom节点,如果两者是相同的节点,返 ...
- linux crontab 命令,最小的执行时间是一分钟,如需要在小于一分钟内重复执行
编写shell脚本实现 crontab.sh #!/bin/bash step=2 #间隔的秒数,不能大于60 for (( i = 0; i < 60; i=(i+step) )); do $ ...
- mycat跟踪分析
mycat版本1.6 192.168.5.66 从 192.168.5.67主 一个user表 验证主从 log4j2修改日志level为debug schema.xml配置 启动服务,打开日志tai ...
- c# 自定义日期的时分秒
DateTime beginTime = DateTime.Now.Date; 2 Console.WriteLine(beginTime); DateTime endTime = , , ); Co ...
- 使用Eclipse的代码追踪功能
在使用Java编写复杂一些的程序时,你会不会常常对一层层的继承关系和一次次方法的调用感到迷惘呢?幸亏我们有了Eclipse这么好的IDE可以帮我们理清头绪--这就要使用Eclipse强大的代码追踪功能 ...
- golang打造基于mail的提醒服务
初识golang 逻辑如下: 程序开启http服务器接收请求,且每隔20秒查询一次表auto_backup中flag为0的值,如果有查到且计划执行时间小于当前时间,则将表to_do的数据抓出来,通过邮 ...
- 注册MongoDB为系统服务(二)
注册MongoDB为系统服务(二)http://blog.csdn.net/qq_35685189/article/details/52304245
- 几个简单的windows API
//将光标移动到x,y位置void gotoxy(int x, int y){ COORD c; c.X = x; c.Y = y; SetConsoleCursorPosition(GetStdHa ...
- SSD硬盘安装win10 且安装千牛工作台频繁卡死问题解决过程
之前win7的时候突然出现卡死现象,具体表现为:磁盘占用百分之百,千牛窗口无法关闭,点截图按钮后,千牛关闭了,并没有截图,千牛聊天输入/无法出现快捷短语了,电脑桌面点击右键没反应,任务栏点击右键也没反 ...
- 背水一战 Windows 10 (122) - 其它: 通过 Windows.System.Profile 命名空间下的类获取信息, 查找指定类或接口的所在程序集的所有子类和子接口
[源码下载] 背水一战 Windows 10 (122) - 其它: 通过 Windows.System.Profile 命名空间下的类获取信息, 查找指定类或接口的所在程序集的所有子类和子接口 作者 ...