コードをhttps://stackoverflow.com/questions/4554014/how-to-examine-and-manipulate-iis-metadata-in-cからVBVcriptに変換しようとしています。
私の問題はこのコードにあります:
Function LocateVirtualDirectory(ByVal siteName, ByVal vdirName)
On Error Resume Next
Dim site
For Each site in w3svc
If (site.KeyType = "IIsWebServer") And (site.ServerComment = siteName) Then
Set LocateVirtualDirectory = GetObject(site.Path & "/ROOT/" & vdirName)
Exit Function
End If
Next
End Function
の場合、ブール式全体が値を受け取りますが、これsite.ServerComment
はFalseではないため、thenステートメントが入力されます。Empty
Empty
その式を書く正しい方法は何ですか?短いほど良いです。
ありがとう。