June 2007 Archives

WMI & LotusScript

In LotusScript, to create WMI Object, then setting default print and getting printer size.

Dim objWMIService As Variant
Dim colInstalledPrinters As Variant
Dim objInstances As Variant
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
n = 0
Forall objPrinter In colInstalledPrinters
Redim Preserve pArray(n) As String
pArray(n) = objPrinter.Name
n = n + 1
End Forall

PrinterPath = ws.Prompt(4,"請選擇印表機","請從下列清單選擇所要使用的印表機:","",pArray)
If Cstr(PrinterPath)="" Then Exit Sub

Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name =" & "'" & PrinterPath & "'")
Forall objPrinter In colInstalledPrinters
Call objPrinter.SetDefaultPrinter()
End Forall
Set objInstances = objWMIService.InstancesOf("Win32_PrinterConfiguration",48)
Forall objInstance In objInstances
If objInstance.name = PrinterPath Then
Msgbox objInstance.Orientation
Msgbox objInstance.PaperSize
End If
End Forall

WMI is very Powerful, even control your PC.

Microsoft: WMI Reference

iSCSI_Target.jpg
雖然SAMBA Server已達到相似的需求,但仍需要透過事先的格式化及設定才能使用。但iSCSI就跟本機磁碟一樣,可自行格式化,只需安裝好iSCSI Initiator。
步驟:
1.Server端(Linux),安裝iSCSI Target,iSCSI Enterprise Target
2.Client端(Windows),安裝iSCSI Initiator,Microsoft iSCSI Software Initiator Version 2.04
3.Client端(Linux),安裝iSCSI Initiator,Open-iSCSI or Linux-iSCSI
這樣就可以讓Windows和Linux直接存取iSCSI Target上的磁碟機。
而為何要iSCSI,因為chm格式的電子書,如果透過網芳共享時,是無法讀到內容,以至於Google Desktop Search沒法針對內容作分析,改用iSCSI方式可以解決這樣的問題。

A Quick Guide to iSCSI on Linux

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Archives

Powered by Movable Type 4.34-en

Recent Comments

  • panandy: 3Q read more
  • Anonymous: philipz大 沒有邀請碼,無法註冊,致無法下載工具 請問有何方法可以解決? 感恩 read more
  • philipz: harushard, It is your java code problem. Check it and read more
  • harushard: java.lang.NoClassDefFoundError: Could not initialize class examples.ExamplesMCRFactory could you explain why read more
  • philipz: IM已經是無解了,建議可以用Plurk Api試看看。 read more
  • ann: hi,請問以上問題解決了沒?可以分享一下嗎? read more
  • Anonymous: 邀請碼沒有~無法下載工具~~怎麼辦 read more
  • Melody: test read more
  • philipz: Ginger: 您好,請您在我的噗浪上留言即可一起討論。 read more
  • Ginger: 版大您好: 在看過您做的期貨即時訊息BOT後覺得很不錯,自己也有一些想法不知能否與您交流與協助呢? 若您覺得ok的話,可以email或是噗浪(ID: king0355)與我聯繫。感謝 : ) read more

About this Archive

This page is an archive of entries from June 2007 listed from newest to oldest.

May 2007 is the previous archive.

July 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.