官术网_书友最值得收藏!

Making a verbatim string

In the preceding line, you need to specify the key-value pairs within the parentheses. The key is notepad.exe. If you try to put a path such as c:\data\samplefile.txt directly into your code, it doesn't work. You see how it gets underlined red? The popup says Represents text as a series of Unicode characters. These things don't work. So, to fix this, you put the @ (at) symbol in front of it. Now, you have a verbatim string.

With the old approach, this is how you handled this: c:\\data\\samplefile.txt. This is called character escaping. If you try this with the preceding line, notice that the red underline goes away because c:\ already means something. So, to escape the usual meaning, you add the second backslash. This is the old way, though. The new way for this situation is to use a verbatim, string so that it's interpreted exactly as it appears.

In this context here, Notepad is the key and the value is the samplefile.txt file.

Next, enter the following line directly beneath the preceding one:

filePrograms.Add("iexplore.exe", "http://www.bing.com");

So, Internet Explorer will open the http://www.bing.com page. You see?

主站蜘蛛池模板: 雷州市| 荥经县| 六安市| 古丈县| 邹平县| 衡水市| 庆云县| 武清区| 满洲里市| 定安县| 五峰| 辽阳市| 资溪县| 平和县| 民权县| 茶陵县| 磴口县| 曲沃县| 乳源| 江口县| 措勤县| 武义县| 渑池县| 洛川县| 彭泽县| 若尔盖县| 安西县| 微博| 黄骅市| 洪湖市| 九龙坡区| 东乡| 抚宁县| 吴桥县| 滕州市| 双柏县| 吉林市| 北辰区| 唐山市| 遵义县| 紫云|