.URL文件编辑 [英] .URL file editing

查看:73
本文介绍了.URL文件编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我对.URL文件(链接到网页的快捷方式文件)有一个疑问.

如何使用MFC/C ++以编程方式从此文件中检索URL?

如何以编程方式将URL写入文件?

[edit]在资源管理器中,我右键单击并创建新的快捷方式.
在第一个屏幕中,我输入一个URL文本,例如:http://www.google.com
在第二个屏幕中,输入快捷方式的名称,例如:mylink
之后,我得到了一个名为mylin.url的文件,该.url在资源管理器视图中不可见.
因此,我要做的是以编程方式从MFC/C ++中的此类文件创建/修改/读取URL.
[/edit]

Hello to everyone,

I have a little question about .URL file (a shortcut file that linked to a web page).

How can I programmatically retrieve the URL from this file using MFC/C++ ?

How can I programmatically write an URL to a file ?

[edit]In explorer, I right click and create new shortcut.
In the first screen I enter an URL text like : http://www.google.com
In the second screen I enter a name for my shortcut like : mylink
After this, I got a file called mylin.url, the .url is not visible in the explorer view.
So, what I want to do is programmatically create/modify/read the URL from such files in MFC/C++
[/edit]

推荐答案

从此文件中获取URL"是什么意思?您指的是哪个文件?如果您将信息存储在文本文件中,则可以使用标准库fstream或MFC CFile来访问它.
What do you mean by "retrieve the URL from this file"? Which file are you referring to? If you have the information stored in a text file then you can use the standard library fstream or the MFC CFile to access it.


确定,您想要读取和写入快捷方式,请尝试如何创建和解决快捷方式 [
OK, you want to read and write shortcuts, try How to create and resolve a shortcut[^], a nice CodeProject article.


创建文本文件内容类似于以下内容:
Create a text file with content similar to the following:
[InternetShortcut]
URL=http://www.codeproject.com/


并以".url"扩展名保存.


and save it with a ".url" extension.


这篇关于.URL文件编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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