FolderItem.GetLink 속성
항목이 바로 가기인 경우 항목의 ShellLinkObject 개체를 포함합니다.
이 속성은 읽기 전용입니다.
구문
objGetLink = FolderItem.GetLink
속성 값
ShellLinkObject 개체를 수신하는 IDispatch 형식의 변수입니다.
예제
다음 예제에서는 GetLink를 사용하여 인터넷 Explorer 바로 가기에 대한 ShellLinkObject 개체를 검색합니다. JScript, VBScript 및 Visual Basic에 대한 적절한 사용법이 표시됩니다.
Jscript:
<script language="JScript">
function fnGetLinkJ()
{
var objShell = new ActiveXObject("shell.application");
var objFolder2;
var ssfPROGRAMS = 2;
objFolder2 = objShell.NameSpace(ssfPROGRAMS);
if (objFolder2 != null)
{
var objFolderItem;
objFolderItem = objFolder2.ParseName("Internet Explorer.lnk");
if (objFolderItem != null)
{
var objLink;
objLink = objFolderItem.GetLink;
if (objLink != null)
{
// Add code here
}
}
}
}
</script>
Vbscript:
<script language="VBScript">
function fnGetLinkVB()
dim objShell
dim bReturn
set objShell = CreateObject("shell.application")
if (not objShell is nothing) then
dim objFolder2
dim ssfPROGRAMS
ssfPROGRAMS = 2
set objFolder2 = objShell.NameSpace(ssfPROGRAMS)
if (not objFolder2 is nothing) then
dim objFolderItem
set objFolderItem = objFolder2.ParseName("Internet Explorer.lnk")
if (not objFolderItem is nothing) then
dim objLink
set objLink = objFolderItem.GetLink
if (not objLink is nothing) then
'Add code here
end if
set objLink = nothing
end if
set objFolderItem = nothing
end if
set objFolder2 = nothing
end if
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnGetLinkVB()
Dim objShell As Shell
Dim objFolder2 As Folder2
Dim ssfPROGRAMS As Long
ssfPROGRAMS = 2
Set objShell = New Shell
Set objFolder2 = objShell.NameSpace(ssfPROGRAMS)
If (Not objFolder2 Is Nothing) Then
Dim objFolderItem As FolderItem
Set objFolderItem = objFolder2.ParseName("Internet Explorer.lnk")
If (Not objFolderItem Is Nothing) Then
Dim objLink As ShellLinkObject
Set objLink = objFolderItem.GetLink
If (Not objLink Is Nothing) Then
'Add code here
Else
'Folder object returned nothing
End If
Set objLink = Nothing
Else
'FolderItem object returned nothing.
End If
Set objFolderItem = Nothing
Else
'Folder object returned nothing.
End If
Set objFolder2 = Nothing
Set objShell = Nothing
End Sub
요구 사항
요구 사항 | 값 |
---|---|
지원되는 최소 클라이언트 |
Windows 2000 Professional, Windows XP [데스크톱 앱만 해당] |
지원되는 최소 서버 |
Windows 2000 Server[데스크톱 앱만] |
헤더 |
|
IDL |
|
DLL |
|
추가 정보