- - PR -
ASP.NETで共有プリンタの取得ができない
1
投稿者 | 投稿内容 |
---|---|
|
投稿日時: 2006-04-21 21:07
ASP.NETでプリンタの一覧を取得しようと思っています。
以下のコードでローカルプリンタは取得できますが、「コントロールパネル」-> 「FAXとプリンタ」内のネットワークプリンタが洩れてしまいます。 ネットワークプリンタを取得する方法は無いのでしょうか。 ご教授下さい。よろしくお願いします。 その1 Dim PrinterName As String For Each PrinterName In Printing.PrinterSettings.InstalledPrinters PrintersDDL.Items.Add(PrinterName) Next その2 Imports DataDynamics.ActiveReports.Interop .... .... Dim PrinterName As String Dim pPrinters As New SystemPrinter For Each PrinterName In pPrinters.PrinterNames PrintersDDL.Items.Add(PrinterName) Next |
|
投稿日時: 2006-04-21 23:01
新しいユーザを作って、そのユーザにネットワークプリンタがあるか、確認してください。
無いなら、そういうことです。ネットワークプリンタのあるユーザに偽装してみてください。 |
|
投稿日時: 2006-04-22 09:51
返信ありがとうございます。解決できました。
この方法でプリンター一覧を取得する為には、プリンタドライバーをインストール後、LocalPortの設定で場所を指定する必要があるって事ですね。 もしくはweb.configで以下の設定で偽装。 <configuration> <system.web> <identity impersonate="true" userName="USERID" password="PASS" /> </system.web> </configuration> |
1