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 ...
随机推荐
- 2019.03.26 bzoj4446: [Scoi2015]小凸玩密室(树形dp)
传送门 题意简述: 给一棵完全二叉树,有点权aia_iai和边权,每个点有一盏灯,现在要按一定要求点亮: 任意时刻点亮的灯泡必须连通 点亮一个灯泡后必须先点亮其子树 费用计算如下:点第一盏灯不要花费 ...
- python模块:csv
""" csv.py - read/write/investigate CSV files """ import re from _csv ...
- jsp(web作业)
一:jsp简介 SP即Java Server Pages,它和servlet技术一样,都是sun公司定义的一种用于开发动态web资源的技术.该技术的最大特点在于:写JSP就像写html,但它相比htm ...
- mvc 路由伪静态实现
很多网站都采用伪静态,例如以html.shtml等结尾的url,mvc的路由可以轻松实现. 配置路由 默认路由配置 添加伪静态路由 mvc的路由原理是从上往下匹配的,所以只需要在后面添加自己配置的路由 ...
- Sql- Group By ,Where,having用法
Group by,where,having 是数据库查询中最常用的几个关键字.在工作中,时常用到,前面遇到一个问题,一个查询中使用了where ,group by ,having及聚集函数时 ,执行顺 ...
- [转] List of OpenFlow Software Projects
List of OpenFlow Software Projects (that I know of) http://yuba.stanford.edu/~casado/of-sw.html (I a ...
- SQL Server 深入解析索引存储(聚集索引)
标签:SQL SERVER/MSSQL SERVER/数据库/DBA/索引体系结构/堆/聚集索引 概述 最近要分享一个课件就重新把这块知识整理了一遍出来,篇幅有点长,想要理解的透彻还是要上机实践. 聚 ...
- Jenkins pipeline 并行执行任务流
笔者在<Jenkins 在声明式 pipeline 中并行执行任务>一文中介绍了如何在声明式 pipeline 中执行并行的任务.前一段时间,Jenkins 发布了 1.3 版的声明式 p ...
- Cannot load php5apache2_4.dll into server
配置PHP开发环境的时候,当进行到在Apache的httpd.conf文件中配置加载PHP模块时发生如下错误 httpd: Syntax error on line 185 of D:/wamp/Ap ...
- Shiro基础
Factory<T>接口(org.apache.shiro.util.Factory) 接口的getInstance()方法是泛型方法,可以用来创建SecurityManager接口对象 ...