ACMSまとめメモ

2012年9月26日

ACMSの調査した結果のメモです。
誤り等を見つけたらお知らせください。

1.ACMS B2B
 ・企業内外のアプリケーション/システムをシームレスに統合するACMS E2X に対し、
  企業間連携機能に特化したB2Bサーバ(ACMS E2Xへのスケールアップも容易)
 ・Javaによりプラットフォームフリー(Webコンテナで動作)
 ・1ファイル送受信、複数ファイルの一括送受信、同報送信/一斉受信等が可能
 ・バッチ、シェル、ユーザ作成プログラムおよびJOB等の実行が可能
 ・ジョブ実行制御
  1) データ交換(AnyTranと同等機能)と連動したジョブ実行制御
2) EDIに必要なデータ編集機能を標準提供
3) GUI画面によるジョブ定義
  4)受信完了時の業務アプリーケーションとの連携
  5) 送達通知による業務アプリーケーションとの連携
  6) 通信終了(正常/異常)に業務アプリケーションの実行が可能
  7) 運用スケジューリング
 ・運用監視ツールとの連携
 ・サポート通信プロトコル
  1) 全銀
  2) JCA
  3) 全銀TCP/IP
  4) INET-Z
  5) FTP手順
  6) HTTP手順
  7) RosettaNet
  8) Chem eStandards
  9) ebXML MS(ECALGA)
  10) ebXML MS 3.0(JEITA)
  11) ebXML MS(流通BMS)
  12) ebXML MS(NACCS)
  13) EDIINT AS2
  14) JX手順
  15) BACREX手順
  16) メールEDI
  17) ACMS WebAgent
  18) ACMS Web/deTradeⅡ
 ・内部連携機能サポートアダプタ
  1) SAP R/3EDIアダプタ
  2) SAP R/3JCOアダプタ
  3) MQアダプタ
  4) RDB連携機能
  5) FAX連携
 ・ブラウザ操作の自動化、ファイル転送型のWeb-EDIサイト構築(ACMS WebAgent同等、ACMS Web/deTradeⅡ)

2.ACMS E2X
・拡張企業モデルの統合データ・エクスチェンジ・ソリューション
 ・企業内外のアプリケーション/システムをシームレスに統合
 ・B2BソリューションとEAIソリューションの連携から統合
 ・ACMS B2Bに以下の機能が追加されている
  1) ミッションクリティカルな要件にも対応。 一部のサーバに障害が発生しても、
    残りのサーバが自動縮退運転
2) 全てのサーバを一台で監視できる統合運用が可能

3.ACMS Lite Neo
 ・中小規模システム向けのEDIクライアント・ソフトウェア
     ・全銀TCP/IP手順(パソコン手順)、JX手順クライアント
 ・通信と各種アプリケーションを組合せて、業務フローの構築が可能
 ・フロー毎の運用カレンダーによる定期的なデータ交換が可能
 ・フォーマット変換(AnyTranと同等機能)
 ・.NET Framework 3.5 SP1で動作
 
4.ACMS/WS
 ・WindowsベースのPOS端末やEDIシステムなどに、全銀TCP/P手順(※拡張Z手順準拠)による
  データ交換機能を実装するファイル転送ツール
 ・ACMS E2X、ACMS B2B等とのファイルの送受信
 ・集配信用のAPIを提供

5.ACMS WebAgent
 ・Web-EDIでの人によるブラウザ操作の手間を省き、運用コストを削減するツール
  取引先サイトへの接続からログイン、取引データの受け渡しなど、Web-EDIでの
  一連のブラウザ操作を自動化。基幹システムとの連携も自動化が可能
 ・ECMAスクリプトを元にブラウザ(Internet Explorer)を起動・制御し、操作を自動実行
 ・ECMAスクリプトはScript Studio(オプション製品)で作成
 ・対応するデータ交換の形態
  1) ファイル交換型
・ファイルのダウンロード/アップロードにより取引データを交換する形態
2) 伝票表示型
・基幹システムなどからデータを取引先画面に埋め込む形態
 (インタラクティブにデータ入力を必要とする場合)
・取引先画面から必要とする取引データを抽出する形態

6.AnyTran
 ・汎用(Any to Any)フォーマット変換ツール
 ・サポートフォーマット
  1) UN/EDIFACT(JEDICOS,JAMA等)
  2) CII(EIAJ,JTRN,HWSW,JPCA等)
  3) XML(RosettaNet,cXML,流通BMS等)
  4) フラットファイル
  5) 固定長(JD-NET,E-VANなど)
  6) 可変長(CSVなど)
  7) SAP R/3 IDoc
  8) X.12
  9) データベース(SQLServer、Oracle、DB2、MySQL、Symfoware)
 ・構成
      1) 変換定義ツール(AnyMapper/動作環境:Windows)
    Windows ベースのGUIを利用したフォーマット変換定義(マッピング)ツール
    a.変換定義
    ・入力フォーマット定義
    ・出力フォーマット定義
・入出力項目の対応付け
    b.定義シンタックス・チェック
c.変換テスト
2) 変換エンジン(AnyTranR/動作環境:JavaVM)
a.変換定義に従ったフォーマット変換機能

GAE環境での文字コードの扱い

2010年1月25日

Stringクラスの漢字などの内容をbyteとして取り出そうとすると

普通はデフォルト文字コードで取出しが出来るのですが、GAE環境では何故かデフォルトは無いらしく(クラウド環境なので…)常にエンコードを指定しなければ

3f3f3f3f等の文字になります、

しかも入りも出も両方必要です。

GAE/j パッケージの変更

2010年1月12日

GAE/j 環境でクラスのパッケージを変更してアップロードするとExceptionが発生します。

AppVersionHandlerMap何かこのクラスが怪しいそうだけど

何をしているのか判らないので…

GAEの環境では決してクラスのパッケージ変更をしないほうが
良いみたいです、何故か、パッケージを変更すると動作しなくなる為
Exceptionで以下のクラスが出現したら、パッケージ構成を元に戻しましょう。
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle

 以上

GAE/j datastore-indexes.xml について

2010年1月12日

datastore-indexes.xml について
日本語と英語のマニュアルで違いがあります。

日本語マニュアルではdatastore-indexes.xmlの中身が
以下のようになっていて開発環境では成功しますが
クラウド環境ではアップロード時に失敗します。

日本語マニュアル、一部抜粋
———————————————
<?xml version=”1.0″ encoding=”utf-8″?>
<datastore-indexes
  xmlns=”http://appengine.google.com/ns/datastore-indexes/1.0
  autoGenerate=”true”>

———————————————

英語マニュアル、一部抜粋
———————————————

<?xml version=”1.0″ encoding=”utf-8″?>
<datastore-indexes
  autoGenerate=”true”>

——————————————— 
英語のマニュアルを見ざるを得ないみたいですね~~

以上

java byte配列コピー2

2009年12月24日

Systemに何故かcopyメソッドが存在?

System.arraycopy(src, 0, dst, count, len);

java byte配列のコピー

2009年12月24日

FileInputStream fis=null;
  try {
   fis = new FileInputStream(fileName);
 
   int count = 0;
   int len;
   byte [] src = new byte[1024];
   try {

 while ((len = fis.read(dst, count, len )) != 0) {  // 読み込み
  count+=len;
 }
   } catch (IOException e) {
    e.printStackTrace();
   }
  } catch (FileNotFoundException e) {
   e.printStackTrace();
  }finally{
   try {
    if(fis != null) {
     fis.close();
    }
   } catch (IOException e) {
    e.printStackTrace();
   }
  }

VB.NET2005でプリンターの設定

2009年12月24日

 

 

 
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices
Imports System.ComponentModel

Public Class PrnDrvClass

    ‘ Constants for DEVMODE
    Dim CCHFORMNAME As Integer = 32
    Dim CCHDEVICENAME As Integer = 32

    ‘ Constants for PRINTER_DEFAULTS.DesiredAccess
    Dim PRINTER_ACCESS_ADMINISTER As Integer = &H4
    Dim PRINTER_ACCESS_USE As Integer = &H8
    Dim STANDARD_RIGHTS_REQUIRED As Integer = &HF0000
    Dim PRINTER_ALL_ACCESS As Integer = (STANDARD_RIGHTS_REQUIRED Or _
      PRINTER_ACCESS_ADMINISTER Or PRINTER_ACCESS_USE)

    ‘ Constants for DocumentProperties() call
    Dim DM_MODIFY As Integer = 8
    ‘  Dim DM_IN_BUFFER As Integer = DM_MODIFY
    Dim DM_COPY As Integer = 2
    ‘ Dim DM_OUT_BUFFER As Integer = DM_COPY

    ‘ Custom constants for this sample’s SelectForm function
    Dim FORM_NOT_SELECTED As Integer = 0
    Dim FORM_SELECTED As Integer = 1
    Dim FORM_ADDED As Integer = 2

    ‘ ユーザー定義の用紙を示す定数の宣言
    Dim FORM_USER As Int32 = &H0&

    ‘/* orientation selections */
    Dim DMORIENT_PORTRAIT As Short = 1
    Dim DMORIENT_LANDSCAPE As Short = 2

    Dim DMPAPER_USER As Integer = 256
    ‘/* field selection bits */

    ‘    Dim DM_ORIENTATION As Integer = &H1&
    Dim DM_FORMNAME As Integer = &H10000
    Dim DM_ORIENTATION As Integer = &H1
    Dim DM_PAPERSIZE As Integer = &H2
    Dim DM_PAPERLENGTH As Integer = &H4
    Dim DM_PAPERWIDTH As Integer = &H8
    Dim DM_SCALE As Integer = &H10
    Dim DM_DEFAULTSOURCE As Integer = &H200
    Dim DMPAPER_A3 As Short = 8 ‘ /* A3 297 x 420 mm                    */
    Dim DMPAPER_A4 As Short = 9  ‘/* A4 210 x 297 mm                    */
    Dim DMPAPER_A4SMALL As Short = 10  ‘/* A4 Small 210 x 297 mm              */
    Dim DMPAPER_A5 As Short = 11  ‘/* A5 148 x 210 mm                    */
    Dim DMPAPER_B4 As Short = 12  ‘/* B4 (JIS) 250 x 354                 */
    Dim DMPAPER_B5 As Short = 13  ‘/* B5 (JIS) 182 x 257 mm              */

    ‘DocumentProperties Use
    Private Const DM_OUT_BUFFER As Short = 2
    Private Const DM_PROMPT As Short = 4
    Private Const DM_IN_PROMPT As Short = DM_PROMPT
    Private Const DM_IN_BUFFER As Short = 8

    ‘幅と高さを定義する構造体の宣言
    <StructLayout(LayoutKind.Sequential)> _
    Public Structure SIZEL
        Public cx As Int32
        Public cy As Int32
    End Structure

    ‘矩形を定義する構造体の宣言
    <StructLayout(LayoutKind.Sequential)> _
    Public Structure RECTL
        Public left As Int32
        Public top As Int32
        Public right As Int32
        Public bottom As Int32
    End Structure

    Public Structure PRINTER_DEFAULTS
        ‘      Dim pDatatype As String
        ‘      Dim pDevMode As IntPtr    ‘ DEVMODE
        ‘      Dim DesiredAccess As Long
        Dim pDatatype As IntPtr
        Dim pDevMode As IntPtr    ‘ DEVMODE
        Dim DesiredAccess As Long
    End Structure

    ‘FORM_INFO_1 (用紙情報を定義する構造体)
    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
    Public Structure FORM_INFO_1
        <MarshalAs(UnmanagedType.I4)> Public Flags As Int32
        <MarshalAs(UnmanagedType.LPTStr)> Public pName As String
        Public Size As SIZEL
        Public ImageableArea As RECTL
    End Structure

    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
    Public Structure PRINTER_INFO_2
        Public pServerName As String
        Public pPrinterName As String
        Public pShareName As String
        Public pPortName As String
        Public pDriverName As String
        Public pComment As String
        Public pLocation As String
        Public pDevMode As IntPtr
        Public pSepFile As String
        Public pPrintProcessor As String
        Public pDatatype As String
        Public pParameters As String
        Public pSecurityDescriptor As IntPtr
        Public Attributes As System.UInt32
        Public Priority As System.UInt32
        Public DefaultPriority As System.UInt32
        Public StartTime As System.UInt32
        Public UntilTime As System.UInt32
        Public Status As System.UInt32
        Public cJobs As System.UInt32
        Public AveragePPM As System.UInt32
    End Structure
    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
     Public Class DEVMODE
        <MarshalAs(UnmanagedType.ByValTStr, sizeconst:=&H20)> _
        Public dmDeviceName As String
        Public dmSpecVersion As Short
        Public dmDriverVersion As Short
        Public dmSize As Short
        Public dmDriverExtra As Short
        Public dmFields As Integer
        Public dmOrientation As Short
        Public dmPaperSize As Short
        Public dmPaperLength As Short
        Public dmPaperWidth As Short
        Public dmScale As Short
        Public dmCopies As Short
        Public dmDefaultSource As Short
        Public dmPrintQuality As Short
        Public dmColor As Short
        Public dmDuplex As Short
        Public dmYResolution As Short
        Public dmTTOption As Short
        Public dmCollate As Short
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=&H20)> _
        Public dmFormName As String
        Public dmLogPixels As Short
        Public dmBitsPerPel As Integer
        Public dmPelsWidth As Integer
        Public dmPelsHeight As Integer
        Public dmDisplayFlags As Integer
        Public dmDisplayFrequency As Integer
        Public dmICMMethod As Integer
        Public dmICMIntent As Integer
        Public dmMediaType As Integer
        Public dmDitherType As Integer
        Public dmICCManufacturer As Integer
        Public dmICCModel As Integer
        Public dmPanningWidth As Integer
        Public dmPanningHeight As Integer
        Public Overrides Function ToString() As String
            Return String.Concat(New Object() {”[DEVMODE: dmDeviceName=", Me.dmDeviceName, ", dmSpecVersion=", Me.dmSpecVersion, ", dmDriverVersion=", Me.dmDriverVersion, ", dmSize=", Me.dmSize, ", dmDriverExtra=", Me.dmDriverExtra, ", dmFields=", Me.dmFields, ", dmOrientation=", Me.dmOrientation, ", dmPaperSize=", Me.dmPaperSize, ", dmPaperLength=", Me.dmPaperLength, ", dmPaperWidth=", Me.dmPaperWidth, ", dmScale=", Me.dmScale, ", dmCopies=", Me.dmCopies, ", dmDefaultSource=", Me.dmDefaultSource, ", dmPrintQuality=", Me.dmPrintQuality, ", dmColor=", Me.dmColor, ", dmDuplex=", Me.dmDuplex, ", dmYResolution=", Me.dmYResolution, ", dmTTOption=", Me.dmTTOption, ", dmCollate=", Me.dmCollate, ", dmFormName=", Me.dmFormName, ", dmLogPixels=", Me.dmLogPixels, ", dmBitsPerPel=", Me.dmBitsPerPel, ", dmPelsWidth=", Me.dmPelsWidth, ", dmPelsHeight=", Me.dmPelsHeight, ", dmDisplayFlags=", Me.dmDisplayFlags, ", dmDisplayFrequency=", Me.dmDisplayFrequency, ", dmICMMethod=", Me.dmICMMethod, ", dmICMIntent=", Me.dmICMIntent, ", dmMediaType=", Me.dmMediaType, ", dmDitherType=", Me.dmDitherType, ", dmICCManufacturer=", Me.dmICCManufacturer, ", dmICCModel=", Me.dmICCModel, ", dmPanningWidth=", Me.dmPanningWidth, ", dmPanningHeight=", Me.dmPanningHeight, "]“})
        End Function
    End Class
    ‘================================================================
    ‘ 
    ‘
    ‘
    ‘================================================================

    ‘Win32API

    Private Declare Auto Function DocumentProperties Lib “winspool.drv” ( _
        ByVal hwnd As IntPtr, _
        ByVal hPrinter As IntPtr, _
        <MarshalAs(UnmanagedType.LPTStr)> ByVal pDeviceNameg As String, _
        ByVal pDevModeOutput As IntPtr, _
        ByVal pDevModeInput As IntPtr, _
        ByVal fMode As Integer) As Int32

    Private Declare Auto Function GlobalLock Lib “kernel32″ (ByVal hmem As IntPtr) As IntPtr
    Private Declare Auto Function GlobalFree Lib “kernel32″ (ByVal hmem As IntPtr) As Int32
    Private Declare Auto Function GlobalUnlock Lib “kernel32″ (ByVal hMem As IntPtr) As Int32
    Private Declare Auto Function OpenPrinter Lib “winspool.drv” ( _
        <MarshalAs(UnmanagedType.LPTStr)> ByVal pPrinterName As String, _
        ByRef phPrinter As IntPtr, _
        ByRef pDefault As PRINTER_DEFAULTS) As Int32

    Private Declare Auto Function ClosePrinter Lib “winspool.drv” (ByVal hPrinter As IntPtr) As Int32

    Private Declare Auto Function SetPrinter Lib “winspool.drv” ( _
        ByVal hPrinter As IntPtr, _
        ByVal Level As Integer, _
        ByVal pForm As IntPtr, _
        ByVal Command As Integer) As Boolean
    Private Declare Auto Function GetPrinter Lib “winspool.drv” ( _
    ByVal hPrinter As IntPtr, ByVal dwLevel As Integer, _
      ByVal pPrinter As IntPtr, ByVal cbBuf As Integer, _
      ByRef pcbNeeded As Integer) As Boolean
    Private Declare Auto Function AddForm Lib “winspool.drv” ( _
        ByVal hPrinter As IntPtr, _
        ByVal Level As Integer, _
        ByVal pForm As IntPtr) As Integer

    Private Declare Auto Function DeleteForm Lib “winspool.drv” (ByVal hPrinter As IntPtr, _
    <MarshalAs(UnmanagedType.LPTStr)> ByVal pName As String) As Integer
    ‘================================================================
    ‘ プリンター設定を指定された用紙サイズと名前で追加し
    ‘ デフォルト設定する
    ‘
    ‘ パラメータ
    ‘ hwnd         :Wndハンドルを指定する
    ‘ printerName  :設定したいプリンター名(コントロールパネルで設定済みのもの)
    ‘ paper        :用紙名称 好きな名前を付ける、削除する際に必要
    ‘ width        :用紙幅
    ‘ height       :用紙高さ
    ‘
    ‘ 戻り値 なし
    ‘
    ‘
    ‘================================================================
    Public Sub addPaper(ByVal hwnd As IntPtr, ByVal printerName As String, _
         ByVal paper As String, ByVal width As Integer, ByVal height As Integer)
        Dim ret As Integer
        Dim hPrinter As IntPtr
        Dim FormInfo1Level As Integer = 1
        Dim FormInfo1 As FORM_INFO_1
        Dim prtFormInfo1 As IntPtr
        Dim pDevMode As DEVMODE
        Dim _PrinterName As String = printerName

        Dim pd As New PRINTER_DEFAULTS
        Dim pPrinterDef As IntPtr = IntPtr.Zero

        Dim pi2 As PRINTER_INFO_2
        Dim pPrinterInfo As IntPtr = IntPtr.Zero
        Try

            pd.DesiredAccess = PRINTER_ALL_ACCESS

            ‘ プリンタのハンドルを取得
            ret = OpenPrinter(printerName, hPrinter, pd)
            If ret = 0 Or hPrinter.Equals(IntPtr.Zero) Then
                Throw New Win32Exception(Marshal.GetLastWin32Error())
                Return
            End If
            With FormInfo1
                ‘ 特性にユーザー定義を指定
                .Flags = FORM_USER
                ‘ 用紙名を指定
                .pName = paper
                ‘ 幅と高さを指定
                .Size.cx = width
                .Size.cy = height
                ‘印刷範囲を指定()
                .ImageableArea.left = 50
                .ImageableArea.top = 50
                .ImageableArea.right = width – 50
                .ImageableArea.bottom = height – 50
            End With

            prtFormInfo1 = Marshal.AllocHGlobal(Marshal.SizeOf(GetType(FORM_INFO_1)))

            Marshal.StructureToPtr(FormInfo1, prtFormInfo1, True)

            ‘ 用紙情報を追加
            ret = AddForm(hPrinter, FormInfo1Level, prtFormInfo1)

            Dim Struct1 As FORM_INFO_1
            Struct1 = CType(Marshal.PtrToStructure(prtFormInfo1, GetType(FORM_INFO_1)), FORM_INFO_1)

            ‘=========================================

            ‘必要なバイト数を取得する
            Dim needed As Integer
            GetPrinter(hPrinter, 2, IntPtr.Zero, 0, needed)
            If needed <= 0 Then
                Throw New Exception(”失敗しました。”)
            End If

            Debug.Print(”needed=” & needed)

            ‘メモリを割り当てる
            pPrinterInfo = Marshal.AllocHGlobal(needed)

            ‘            Dim globalDevIn As IntPtr = GlobalLock(PtrDMIn)

            ‘プリンタ情報を取得する
            Dim temp As Integer
            If Not GetPrinter(hPrinter, 2, pPrinterInfo, needed, temp) Then
                Throw New Win32Exception(Marshal.GetLastWin32Error())
            End If

            Debug.Print(”temp=” & temp)

            ‘PRINTER_INFO_2型にマーシャリングする
            pi2 = CType(Marshal.PtrToStructure( _
                pPrinterInfo, GetType(PRINTER_INFO_2)), PRINTER_INFO_2)
            ‘ 構造体とポインターの変換 pi2.pDevMode
            pDevMode = CType(Marshal.PtrToStructure(pi2.pDevMode, _
                GetType(DEVMODE)), DEVMODE)
            Debug.Print(”変更前=” & pDevMode.dmFormName)
            Debug.Print(”変更前dmPaperWidth=” & pDevMode.dmPaperWidth)
            Debug.Print(”変更前dmPaperLength=” & pDevMode.dmPaperLength)
            pDevMode.dmFormName = paper & Chr(0)   ‘ Must be NULL terminated!

            ‘ Set the dmFields bit flag to indicate what you are changing.
            pDevMode.dmFields = DM_FORMNAME

            Debug.Print(”変更後=” & pDevMode.dmFormName)
            Debug.Print(”変更後dmPaperWidth=” & pDevMode.dmPaperWidth)
            Debug.Print(”変更後dmPaperLength=” & pDevMode.dmPaperLength)

            Marshal.StructureToPtr(pDevMode, pi2.pDevMode, False)

            ret = DocumentProperties(hwnd, hPrinter, _PrinterName, pi2.pDevMode, _
                pi2.pDevMode, DM_IN_BUFFER Or DM_OUT_BUFFER)

            Marshal.StructureToPtr(pi2, pPrinterInfo, False)

            ‘/* プリンタ情報のアップデート */
            Dim b As Boolean = SetPrinter(hPrinter, 2, pPrinterInfo, 0)
            If b = True Then
                MsgBox(”プリンタードライバーの設定。”)
            Else
                Debug.Print(”err=” & Marshal.GetLastWin32Error())

                ‘     Dim LangOptions As Long
                ‘     LangOptions = &H0
                ‘     Dim buffer As String
                ‘     buffer = Space(256)
                ‘     lngReturn = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0&, Err.LastDllError, LangOptions, buffer, Len(buffer), 0&)
                ‘     MsgBox(”Could not set printer: ” & buffer)

                MsgBox(Marshal.GetLastWin32Error())
                ‘             Throw New Win32Exception(Marshal.GetLastWin32Error())
            End If

 

            If ret <= 0 Then
                Throw New Win32Exception(Marshal.GetLastWin32Error())
            End If

        Catch ex As Exception
            MessageBox.Show(ex.Message, “エラー”)

        Finally

            ‘後始末をする
            Marshal.FreeHGlobal(pPrinterInfo)

            If Not hPrinter.Equals(IntPtr.Zero) Then
                ClosePrinter(hPrinter)
            End If
            ‘        Marshal.FreeHGlobal(prtFormInfo1)

        End Try
    End Sub
    ‘================================================================
    ‘ユーザー定義サイズ用紙削除
    ‘
    ‘ パラメータ
    ‘ printerName  :設定したいプリンター名(コントロールパネルで設定済みのもの)
    ‘ paper        :用紙名称 好きな名前を付ける、削除する際に必要
    ‘
    ‘ 戻り値 なし
    ‘
    ‘
    ‘================================================================
    Public Sub DeletePaperForm(ByVal printerName As String, ByVal paper As String)
        Dim ret As Integer
        Dim hPrinter As IntPtr
        Dim pd As New PRINTER_DEFAULTS

        pd.DesiredAccess = PRINTER_ALL_ACCESS

        Try
            ‘ プリンタのハンドルを取得
            ret = OpenPrinter(printerName, hPrinter, pd)
            If ret = 0 Or hPrinter.Equals(IntPtr.Zero) Then
                Return
            End If

            ‘ 用紙の削除
            ret = DeleteForm(hPrinter, paper)

            If ret <= 0 Then
                Throw New Win32Exception(Marshal.GetLastWin32Error())
            End If
            MsgBox(”delete sucess”)
        Catch ex As Exception
            MessageBox.Show(ex.Message, “エラー”)
        Finally
            If Not hPrinter.Equals(IntPtr.Zero) Then
                ClosePrinter(hPrinter)
            End If
        End Try
    End Sub

End Class

apache 仮想ホストの設定

2009年12月8日

apache2.2.3-22.el5.centos.2で仮想ホストの設定です

Windows版ではhttpd.confからincludeする設定になっていますが

Linux版では何故か古いままです、これってCentOS4.3のデフォルトで入っているapacheの設定が更新されないのかもしれません。

以下はhttp.conf の抜粋
~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
NameVirtualHost *:80  <-この行はコメントを解除します
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
#

以下の行はオリジナルのものをコピーしてコメントを削除します
<VirtualHost *:80>
    ServerAdmin admin@oarts.jp
    DocumentRoot /var/www/blog
    ServerName blog.oarts.jp
    ErrorLog logs/error.log
    CustomLog logs/access.log common
</VirtualHost>
#
#

以下はデフォルトのコンテンツを追加したものです。
<VirtualHost *:80>
ServerAdmin admin@oarts.jp
    DocumentRoot /var/www/html
    ServerName www.oarts.jp
    ErrorLog logs/error.log
    CustomLog logs/access.log common
</VirtualHost>
~~~~~~~~~~~~~~~~~~~~~~~~~~