본문 바로가기
Application/Delphi Lecture

URL File Format

by 현이빈이 2008. 8. 13.
반응형

An Unofficial Guide to the URL File Format

3rd Edition

Copyright 1998-2004 Edward L. Blake

All Rights Reserved



 

No part of this document may be reproduced in any form, mechanically or digitally, or transmitted or redistributed in any form by any means without the prior written permission from the author, Edward L. Blake. Edward Blake can be contacted at http://www.edwardblake.name/contact



This article is an update to my previous postings on wotsit.org. A new update to this article (2004) is finally changing around the modified field decoding to using, the more correct method, FILETIME and FileTimeToSystemTime.


Disclaimer: Please note that I am not the person, and I’m not involved with the one(s), who made the URL format. The information presented here is at most a description of how a URL file looks like and how to read it based on my experimentation and experience. Credit is given within the article for feedback and corrections on earlier content,


THE URL FORMAT


The classic URL file format is pretty simple; it has a format similar to an INI file:


Sample URL File:

_______________________________________________________


[InternetShortcut]

URL=http://www.someaddress.com/

WorkingDirectory=C:\WINDOWS\

ShowCommand=7

IconIndex=1

IconFile=C:\WINDOWS\SYSTEM\url.dll

Modified=20F06BA06D07BD014D

HotKey=1601

_______________________________________________________


The syntax of the file format is like the following:


[Group\Section]

Field=Value

Field=Value

.

.


Each line terminates with CR and LF characters, and uses ANSI as it’s character set. The files can be manipulated using basic file I\O or the GetPrivateProfileString, GetPrivateProfileSection, WritePrivateProfileSection, WritePrivateProfileSring API functions provided by Windows.


URL

The URL field is self-explanatory. It’s the address location of the page to load. It should be a fully qualifying URL with the format protocol://server/page. A URL file is not restricted to the HTTP protocol. In general, at least, whatever that can be saved as a favorite is a valid URL.



WorkingDirectory

It’s the “working folder” that your URL file uses. The working folder is possibly the folder to be set as the current folder for the application that would open the file. However Internet Explorer does not seem to be affected by this field.

Note: this setting does not seem to appear in some versions of Internet Explorer/Windows.



IconIndex

The Icon Index within the icon library specified by IconFile. In an icon library, which can be generally be either a ICO, DLL or EXE file, the icons are indexed with numbers. The first icon index starts at 0.



IconFile

Specifies the path of the icon library file. Generally the icon library can be an ICO, DLL or EXE file. The default icon library used tends to be the URL.DLL library on the system’s Windows\System directory



Modified

This field is generally the most cryptic of all the fields.

Example: Modified=20F06BA06D07BD014D

For a while some vague calculations were given on this page for calculating the date and time of the modified field, but since the first posting of this article I’ve received a lot of input from other people that have experimented with this field:


Changes at a fast pace

Changes slowly

C

C0

34

90

B3

07

DC

C3

01

DE


Thanks goes to Shawn K. Hall, Jeff Dickey, Ken Schenke, Vivian De Smedt, David Jones, Frank Stocker, and possibly others (I’ve lost some mail since a few years ago) for pointing out this is a FILETIME structure (this article has last been updated in late 2000, basically 3-4 years, so I’ve been late to rewrite this section), The first 8 hex bytes are the FILETIME structure, the last hex byte is found to be a checksum and is unimportant. Since this is a FILETIME structure, you can pass it to the FileTimeToSystemTime API call to get all the discrete date and time elements. However the first 8 hex bytes need to be inverted before passing in to FileTimeToSystemTime. Therefore:


C0

34

90

B3

07

DC

C3

01

DE

Invert

Rem.

01

C3

DC

07

B3

90

34

C0


High DW = 01 C3 DC 07

Low DW = B3 90 34 C30

 

FileTimeToSystemTime

 

16/1/2004 08:06:53

 


 

I’ve wrote a small VB6 demonstration that does this task.


ShowCommand

(Nothing) - Normal

7         - Minimized

3         - Maximized

Note: this setting does not seem to appear in some versions of Internet Explorer/Windows.



HotKey

The HotKey field specifies what is the shortcut key used to automatically launch the Internet shortcut. The field uses a number to specify what hotkey is used.


833 – Ctrl + Shift + A

834 – Ctrl + Shift + B

835 – Ctrl + Shift + C

.

.

1345 – Shift + Alt + A

1346 – Shift + Alt + B

1347 – Shift + Alt + C

.

.

1601 – Ctrl + Alt + A

1602 – Ctrl + Alt + B

1603 – Ctrl + Alt + C

.

Refer to Appendix A for a more complete table of hotkeys.



EXTENDED URL FORMAT

Sometimes the URL file will provide more information when it is saved as a Favorite with the following format:


[DEFAULT]

BASEURL=url

 

[DOC#n(#n#n#n…)]

BASEURL=url

ORIGURL=url


Sample URL File with extended URL fields:

_______________________________________________________


[DEFAULT]

BASEURL=http://www.someaddress.com

[DOC#4#5]

BASEURL=http://www.someaddress.com/frame1.html

ORIGURL=frame1.html

[DOC#4#6]

BASEURL=http://www.someaddress.com/frame2.html

ORIGURL=frame2.html

[InternetShortcut]

URL=http://www.someaddress.com/

_______________________________________________________


The purpose of these extra fields is probably for the browser to figure out what HTML documents were loaded in each frame, since the main URL tends to not record the state of its framesets. If you navigate to a framed site, click on a frame link (which changes one of the frames), and add the page to your favorites, the state of the framesets is preserved. When a frame is nested inside another frame, the frame’s section name has the same first numbers, and another few numbers appended, like the following:


Sample URL File with extended URL fields and nested frames:

_______________________________________________________


[DEFAULT]

BASEURL=http://www.someaddress.com

[DOC#4#5]

BASEURL=http://www.someaddress.com/frame1.html

ORIGURL=frame1.html

[DOC#4#5#4#6]

BASEURL=http://www.someaddress.com/frame1a.html

ORIGURL=frame1a.html

[DOC#4#5#4#7]

BASEURL=http://www.someaddress.com/frame1b.html

ORIGURL=frame1b.html

[DOC#4#6]

BASEURL=http://www.someaddress.com/frame2.html

ORIGURL=frame2.html

 [InternetShortcut]

URL=http://www.someaddress.com/

_______________________________________________________


SETTINGS NOT STORED IN THE URL FORMAT


Visits

“Make this page available offline”

Synchronization settings

Download Settings

Schedule Settings



LINKS


 

Information on many other file formats

http://www.wotsit.org/


Author’s Web Site

http://www.cyanwerks.com/


Contacting the author


http://www.edwardblake.name/contact



APPENDIX A – HotKey Reference



C+S

S+A

C+A

C+S+A


C+S

S+A

C+A

C+S+A

A

833

1345

1601

1857

0

817

1329

1584

1841

B

834

1346

1602

1858

1

818

1330

1585

1842

C

835

1347

1603

1859

2

819

1331

1586

1843

D

836

1348

1604

1860

3

820

1332

1587

1844

E

837

1349

1605

1861

4

821

1333

1588

1845

F

838

1350

1606

1862

5

822

1334

1589

1846

G

839

1351

1607

1863

6

823

1335

1590

1847

H

840

1352

1608

1864

7

824

1336

1591

1848

I

841

1353

1609

1865

8

825

1337

1592

1849

J

842

1354

1610

1866

9

826

1338

1593

1850

K

843

1355

1611

1867

;

954

1466

1722

1978

L

844

1356

1612

1868

=

955

1467

1723

1979

M

845

1357

1613

1869

,

956

1468

1724

1980

N

846

1358

1614

1870

-

957

1469

1725

1981

O

847

1359

1615

1871

.

958

1470

1726

1982

P

848

1360

1616

1872

/

959

1471

1727

1983

Q

849

1361

1617

1873

`

960

1472

1728

1984

R

850

1362

1618

1874

[

987

1499

1755

2011

S

851

1363

1619

1875

\

988

1500

1756

2012

T

852

1364

1620

1876

]

989

1501

1757

2013

U

853

1365

1621

1877

990

1502

1758

2014

V

854

1366

1622

1878






W

855

1367

1623

1879






X

856

1368

1624

1880






Y

857

1369

1625

1881






Z

858

1370

1626

1882








None

Ctrl

Alt

Shift

C+A

S+A

C+S

C+S+A

F1

112

624

1136

368

1648

1392

880

1904

F2

113

625

1137

369

1649

1393

881

1905

F3

114

626

1138

370

1650

1394

882

1906

F4

115

627

1139

371

1651

1395

883

1907

F5

116

628

1140

372

1652

1396

884

1908

F6

117

629

1141

373

1653

1397

885

1909

F7

118

630

1142

374

1654

1398

886

1910

F8

119

631

1143

375

1655

1399

887

1911

F9

120

632

1144

376

1656

1400

888

1912

F10

121

633

1145

377

1657

1401

889

1913

F11

122

634

1146

378

1658

1402

890

1914

F12

123

635

1147

379

1659

1403

891

1915

반응형