惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - DarkAngel

好久未登陆 签到 Silverlight 3正式版新鲜出炉 Silverlight3的7个新功能[转] 读取DWG文件中的文本信息(CAD2004) 一个端口扫描的小程序 WEBPART结合实际的应用(.Net2005) 带验证功能的的TextBox 一个很老的故事: 水和鱼的故事 Browser.Net浏览器c#开发(开源) 吉祥三宝(设计篇) - DarkAngel - 博客园 Microsoft.Press.Microsoft.Visual.C.Sharp.2005.Step.by.Step.Oct.2005 取客户端MAC地址的方法 关于在活动目录(ACTIVE DIRECTORY)中创建组织单位和用户 Exchange 2k的安装与删除。 无 Cookie 的 ASP.NET 一个任意获得页面控件的方法 跨页面的多选功能实现 买不起笔记本,只好自己动手做一个啦-!(转)
将指定网页添加到收藏夹的方法(c#)
DarkAngel · 2006-05-12 · via 博客园 - DarkAngel

  昨天想实现一个小功能,就是把正在浏览的某网页添加到收藏夹中。以前在页面直接用JAVASCRIPT调用一个方法就搞定了,现在我是想用WINFORM来实现,我自己找了一下没有看到相关的方法(可能找的不仔细)。于是想了一下决定自己实现算了。
  完成这个功能主要是两步,首先要取得系统用户的收藏夹目录,第二是要根据获得页面地址在收藏夹目录创建一个快捷方式。
要获得收藏加目录我们可以用GetFolderPath方法来完成,代码如下

1string path=Environment.GetFolderPath(System.Environment.SpecialFolder.Favorites);

要创建快捷方式需要用到IWshRuntimeLibrary命名空间,在这里我们要USING一下。并在引用里添加一个COM,windows script host object model。添加到收藏夹方法如下“

 1public void addFavorites(string url,string filename,string savepath)
 2        {
 3            string path=Environment.GetFolderPath(System.Environment.SpecialFolder.Favorites);
 4            if(!System.IO.File.Exists(path+"\\"+filename+savepath+".url"))
 5            {
 6                
 7                IWshShell_Class shell = new IWshShell_ClassClass(); 
 8                IWshURLShortcut shortcut=null;
 9                if(savepath=="Favorites")
10                {
11                    shortcut = shell.CreateShortcut(Environment.GetFolderPath(System.Environment.SpecialFolder.Favorites)+"\\"+filename+".url"as IWshURLShortcut;
12                }

13                else
14                {
15                    shortcut = shell.CreateShortcut(Environment.GetFolderPath(System.Environment.SpecialFolder.Favorites)+"\\"+savepath+"\\"+filename+".url"as IWshURLShortcut;
16                }

17                 
18                shortcut.TargetPath = url; 
19                shortcut.Save();
20            }

21        }

其中URL是你要保存网页的路径,filename是生成快捷方式的名称,savepath是在收藏夹中保存在哪个目录。
顺便想提个问题,有谁知道如何得到AxWebBrowser对象中statustext。