[perl] 윈도우즈 네트웍 드라이브 연결하기

윈도우즈에서 펄언어로 네트웍 드라이브 연결하는 방법

my $LocalName = 'Z:';
my $RemoteName = "\\\\remotemachine\\log";
my $UpdateProfile = 0;
my $User = 'xxxxxx';
my $Password = 'xxxxxx';
my $Force = 1;

my $objnet=Win32::OLE->CreateObject("Wscript.Network");

#네트웍 드라이브 연결
$objnet->MapNetworkDrive($LocalName, $RemoteName, $UpdateProfile, $User, $Password);

#네트웍 드라이브 해제
$objnet->RemoveNetworkDrive($LocalName, $Force, $UpdateProfile);

[CSS] td 안에 이미지가 있을 경우 약간의 공백이 생기는 경우

<div style=”font-size:0px;”>
<table border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td><img src=”test2.jpg” /></td>
</tr>
<tr>
<td><img src=”test2.jpg” /></td>
</tr>
</table>
위처럼 font-size:0px 을 지정해주면 된다.

VBScript: 크기가 정해지지 않은 DynamicArray 클래스

DynamicArray 클래스

Class DynamicArray
    '************** Properties **************
    Private aData
    '****************************************

    '*********** Event Handlers *************
    Private Sub Class_Initialize()
        Redim aData(0)
    End Sub
    '****************************************

    '************ Property Get **************
    Public Property Get Data(iPos)
        'Make sure the end developer is not requesting an
        '"out of bounds" array element
        If iPos < LBound(aData) or iPos > UBound(aData) then
            Exit Property    'Invalid range
        End If

        Data = aData(iPos)
    End Property

    Public Property Get DataArray()
        DataArray = aData
    End Property
    '****************************************

    '************ Property Let **************
    Public Property Let Data(iPos, varValue)
        'Make sure iPos >= LBound(aData)
        If iPos < LBound(aData) Then Exit Property

        If iPos > UBound(aData) then
            'We need to resize the array
            Redim Preserve aData(iPos)
            aData(iPos) = varValue
        Else
            'We don't need to resize the array
            aData(iPos) = varValue
        End If
    End Property
    '****************************************


    '************** Methods *****************
    Public Function StartIndex()
        StartIndex = LBound(aData)
    End Function

    Public Function StopIndex()
        StopIndex = UBound(aData)
    End Function

    Public Sub Delete(iPos)
        'Make sure iPos is within acceptable ranges
        If iPos < LBound(aData) or iPos > UBound(aData) then
            Exit Sub    'Invalid range
        End If

        Dim iLoop
        For iLoop = iPos to UBound(aData) - 1
            aData(iLoop) = aData(iLoop + 1)
        Next

        Redim Preserve aData(UBound(aData) - 1)
    End Sub
    '****************************************
End Class

출처: http://www.4guysfromrolla.com/webtech/032800-1.shtml