[sqlplus_desc]
clsDesc.vb
Public Class clsDesc
Public Property c0Name As String = ""
Public Property c1Null As String = ""
Public Property c2Type As String = ""
End Class
frmTabFile.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmTabFile
Inherits System.Windows.Forms.Form
'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows フォーム デザイナーで必要です。
Private components As System.ComponentModel.IContainer
'メモ: 以下のプロシージャは Windows フォーム デザイナーで必要です。
'Windows フォーム デザイナーを使用して変更できます。
'コード エディターを使って変更しないでください。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.TxtConnect = New System.Windows.Forms.TextBox()
Me.TxtTableName = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.Label3 = New System.Windows.Forms.Label()
Me.TxtWorkFolder = New System.Windows.Forms.TextBox()
Me.DataGridView1 = New System.Windows.Forms.DataGridView()
Me.Column1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Column2 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Column3 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.TxtTxtFile = New System.Windows.Forms.TextBox()
Me.TxtSqlFile = New System.Windows.Forms.TextBox()
Me.TxtBatFile = New System.Windows.Forms.TextBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.ChkDelWorkFile = New System.Windows.Forms.CheckBox()
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 9)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(47, 12)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Connect"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(12, 35)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(62, 12)
Me.Label2.TabIndex = 1
Me.Label2.Text = "TableName"
'
'TxtConnect
'
Me.TxtConnect.Location = New System.Drawing.Point(81, 6)
Me.TxtConnect.Name = "TxtConnect"
Me.TxtConnect.Size = New System.Drawing.Size(100, 19)
Me.TxtConnect.TabIndex = 2
'
'TxtTableName
'
Me.TxtTableName.Location = New System.Drawing.Point(81, 31)
Me.TxtTableName.Name = "TxtTableName"
Me.TxtTableName.Size = New System.Drawing.Size(100, 19)
Me.TxtTableName.TabIndex = 3
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(435, 2)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 4
Me.Button1.Text = "tab作成"
Me.Button1.UseVisualStyleBackColor = True
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(12, 59)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(62, 12)
Me.Label3.TabIndex = 5
Me.Label3.Text = "WorkFolder"
'
'TxtWorkFolder
'
Me.TxtWorkFolder.Location = New System.Drawing.Point(81, 56)
Me.TxtWorkFolder.Name = "TxtWorkFolder"
Me.TxtWorkFolder.Size = New System.Drawing.Size(100, 19)
Me.TxtWorkFolder.TabIndex = 6
Me.TxtWorkFolder.Text = "C:\Temp"
'
'DataGridView1
'
Me.DataGridView1.AllowUserToAddRows = False
Me.DataGridView1.AllowUserToDeleteRows = False
Me.DataGridView1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.Column1, Me.Column2, Me.Column3})
Me.DataGridView1.Location = New System.Drawing.Point(14, 81)
Me.DataGridView1.Name = "DataGridView1"
Me.DataGridView1.ReadOnly = True
Me.DataGridView1.RowTemplate.Height = 21
Me.DataGridView1.Size = New System.Drawing.Size(744, 385)
Me.DataGridView1.TabIndex = 7
'
'Column1
'
Me.Column1.HeaderText = "名前"
Me.Column1.Name = "Column1"
Me.Column1.ReadOnly = True
'
'Column2
'
Me.Column2.HeaderText = "NULL?"
Me.Column2.Name = "Column2"
Me.Column2.ReadOnly = True
'
'Column3
'
Me.Column3.HeaderText = "型"
Me.Column3.Name = "Column3"
Me.Column3.ReadOnly = True
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(234, 9)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(38, 12)
Me.Label4.TabIndex = 8
Me.Label4.Text = "txtFile"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(234, 35)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(39, 12)
Me.Label5.TabIndex = 9
Me.Label5.Text = "sqlFile"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(234, 59)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(40, 12)
Me.Label6.TabIndex = 10
Me.Label6.Text = "batFile"
'
'TxtTxtFile
'
Me.TxtTxtFile.Location = New System.Drawing.Point(280, 6)
Me.TxtTxtFile.Name = "TxtTxtFile"
Me.TxtTxtFile.Size = New System.Drawing.Size(100, 19)
Me.TxtTxtFile.TabIndex = 11
Me.TxtTxtFile.Text = "desc.txt"
'
'TxtSqlFile
'
Me.TxtSqlFile.Location = New System.Drawing.Point(280, 31)
Me.TxtSqlFile.Name = "TxtSqlFile"
Me.TxtSqlFile.Size = New System.Drawing.Size(100, 19)
Me.TxtSqlFile.TabIndex = 12
Me.TxtSqlFile.Text = "desc.sql"
'
'TxtBatFile
'
Me.TxtBatFile.Location = New System.Drawing.Point(280, 56)
Me.TxtBatFile.Name = "TxtBatFile"
Me.TxtBatFile.Size = New System.Drawing.Size(100, 19)
Me.TxtBatFile.TabIndex = 13
Me.TxtBatFile.Text = "desc.bat"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(435, 27)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 14
Me.Button2.Text = "tab開く"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(435, 52)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(75, 23)
Me.Button3.TabIndex = 15
Me.Button3.Text = "フォルダ開く"
Me.Button3.UseVisualStyleBackColor = True
'
'ChkDelWorkFile
'
Me.ChkDelWorkFile.AutoSize = True
Me.ChkDelWorkFile.Checked = True
Me.ChkDelWorkFile.CheckState = System.Windows.Forms.CheckState.Checked
Me.ChkDelWorkFile.Location = New System.Drawing.Point(551, 5)
Me.ChkDelWorkFile.Name = "ChkDelWorkFile"
Me.ChkDelWorkFile.Size = New System.Drawing.Size(85, 16)
Me.ChkDelWorkFile.TabIndex = 16
Me.ChkDelWorkFile.Text = "DelWorkFile"
Me.ChkDelWorkFile.UseVisualStyleBackColor = True
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(770, 478)
Me.Controls.Add(Me.ChkDelWorkFile)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.TxtBatFile)
Me.Controls.Add(Me.TxtSqlFile)
Me.Controls.Add(Me.TxtTxtFile)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.DataGridView1)
Me.Controls.Add(Me.TxtWorkFolder)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TxtTableName)
Me.Controls.Add(Me.TxtConnect)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "TableNameを基にtabファイルを作成"
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TxtConnect As System.Windows.Forms.TextBox
Friend WithEvents TxtTableName As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents TxtWorkFolder As System.Windows.Forms.TextBox
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
Friend WithEvents Column1 As System.Windows.Forms.DataGridViewTextBoxColumn
Friend WithEvents Column2 As System.Windows.Forms.DataGridViewTextBoxColumn
Friend WithEvents Column3 As System.Windows.Forms.DataGridViewTextBoxColumn
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents TxtTxtFile As System.Windows.Forms.TextBox
Friend WithEvents TxtSqlFile As System.Windows.Forms.TextBox
Friend WithEvents TxtBatFile As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents ChkDelWorkFile As System.Windows.Forms.CheckBox
End Class
frmTabFile.vb
Imports System.Text.RegularExpressions
Public Class frmTabFile
Private Enum me_Col
c0Name
c1Null
c2Type
End Enum
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.TxtConnect.Text = pf_GetIni("", "DESC", "Connect", "ユーザ名/パスワード@ネットサービス名")
Me.TxtTableName.Text = pf_GetIni("", "DESC", "TableName", "DUAL")
Me.TxtWorkFolder.Text = pf_GetIni("", "DESC", "WorkFolder", "C:\Temp")
Me.TxtTxtFile.Text = pf_GetIni("", "DESC", "txtFile", "desc.txt")
Me.TxtSqlFile.Text = pf_GetIni("", "DESC", "sqlFile", "desc.sql")
Me.TxtBatFile.Text = pf_GetIni("", "DESC", "batFile", "desc.bat")
End Sub
Private Sub Form1_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Call ps_PutIni("", "DESC", "Connect", Me.TxtConnect.Text)
Call ps_PutIni("", "DESC", "TableName", Me.TxtTableName.Text)
Call ps_PutIni("", "DESC", "WorkFolder", Me.TxtWorkFolder.Text)
Call ps_PutIni("", "DESC", "txtFile", Me.TxtTxtFile.Text)
Call ps_PutIni("", "DESC", "sqlFile", Me.TxtSqlFile.Text)
Call ps_PutIni("", "DESC", "batFile", Me.TxtBatFile.Text)
If Me.ChkDelWorkFile.Checked Then
Dim w_TxtFile As String = String.Format("{0}\{1}", Me.TxtWorkFolder.Text, Me.TxtTxtFile.Text)
Dim w_SqlFile As String = String.Format("{0}\{1}", Me.TxtWorkFolder.Text, Me.TxtSqlFile.Text)
Dim w_BatFile As String = String.Format("{0}\{1}", Me.TxtWorkFolder.Text, Me.TxtBatFile.Text)
Call ms_DelFile(w_BatFile)
Call ms_DelFile(w_SqlFile)
Call ms_DelFile(w_TxtFile)
End If
End Sub
Private Sub DataGridView1_CellPainting(sender As Object, e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
If e.ColumnIndex < 0 AndAlso e.RowIndex >= 0 Then
Call e.Paint(e.ClipBounds, DataGridViewPaintParts.All)
Dim rect As Rectangle = e.CellBounds
Call rect.Inflate(-2, -2)
Call TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), e.CellStyle.Font, rect, e.CellStyle.ForeColor, TextFormatFlags.Right Or TextFormatFlags.VerticalCenter)
e.Handled = True
End If
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim w_TxtFile As String = String.Format("{0}\{1}", Me.TxtWorkFolder.Text, Me.TxtTxtFile.Text)
Dim w_TableName As String = Me.TxtTableName.Text.ToUpper
Dim w_Desc As String = mf_Desc(w_TxtFile, w_TableName, Me.TxtConnect.Text)
Dim w_SqlFile As String = String.Format("{0}\{1}", Me.TxtWorkFolder.Text, Me.TxtSqlFile.Text)
Call ms_StreamWriter(w_SqlFile, w_Desc)
Dim w_BatCommand As String = String.Format("SQLPLUS {0} @{1}", Me.TxtConnect.Text, w_SqlFile)
Dim w_BatFile As String = String.Format("{0}\{1}", Me.TxtWorkFolder.Text, Me.TxtBatFile.Text)
Call ms_StreamWriter(w_BatFile, w_BatCommand)
Call ms_StartProcessWaitForExit(w_BatFile)
Dim w_FileText As String = mf_GetFileText(w_TxtFile)
Dim w_StringList As List(Of String) = mf_FileTextToStringList(w_FileText)
Dim w_DescList As List(Of clsDesc) = mf_StringListToDescList(w_StringList)
Me.DataGridView1.Rows.Clear()
If w_DescList.Count > 0 Then
Me.DataGridView1.Rows.Add(w_DescList.Count)
For i As Integer = 0 To w_DescList.Count - 1
Me.DataGridView1.Rows(i).Cells(me_Col.c0Name).Value = w_DescList(i).c0Name
Me.DataGridView1.Rows(i).Cells(me_Col.c1Null).Value = w_DescList(i).c1Null
Me.DataGridView1.Rows(i).Cells(me_Col.c2Type).Value = w_DescList(i).c2Type
Next
Me.DataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells)
Dim sb As New sb()
For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
Dim w_c0Name As String = mf_ObjectToString(Me.DataGridView1.Rows(i).Cells(me_Col.c0Name).Value)
Dim w_c1Null As String = mf_ObjectToString(Me.DataGridView1.Rows(i).Cells(me_Col.c1Null).Value)
Dim w_c2Type As String = mf_ObjectToString(Me.DataGridView1.Rows(i).Cells(me_Col.c2Type).Value)
sb.Add("{1}{0}{2}{0}{3}", vbTab, w_c0Name, w_c1Null, w_c2Type)
Next
Dim w_tabFile As String = String.Format("{0}\{1}.tab", Me.TxtWorkFolder.Text, Me.TxtTableName.Text)
Call ms_StreamWriter(w_tabFile, sb.ToString)
Select Case MsgBox("tabファイルを開きますか。", MsgBoxStyle.YesNo Or MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.SystemModal, "確認")
Case MsgBoxResult.Yes
Call ms_StartProcess(w_tabFile)
Case Else
End Select
End If
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim w_tabFile As String = String.Format("{0}\{1}.tab", Me.TxtWorkFolder.Text, Me.TxtTableName.Text)
Call ms_StartProcess(w_tabFile)
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
Dim w_WorkFolder As String = Me.TxtWorkFolder.Text
Call ms_StartProcess(w_WorkFolder)
End Sub
Private Function mf_Desc(wp_TxtFile As String, wp_TableName As String, wp_Connect As String) As String
Dim sb As New sb()
sb.Add("connect {0}", wp_Connect)
sb.Add("set echo off")
sb.Add("set heading off")
sb.Add("set pagesize 0")
sb.Add("set feedback off")
sb.Add("set linesize 80")
sb.Add("set trimspool on")
sb.Add("spool {0}", wp_TxtFile)
sb.Add("desc {0}", wp_TableName)
sb.Add("spool off")
sb.Add("set linesize 80")
sb.Add("clear")
sb.Add("exit")
Return sb.ToString
End Function
Private Sub ms_StreamWriter(wp_File As String, wp_Text As String)
Dim enc As System.Text.Encoding = System.Text.Encoding.GetEncoding("shift_jis")
Dim sw As New System.IO.StreamWriter(wp_File, False, enc)
sw.Write(wp_Text)
sw.Close()
End Sub
Private Sub ms_StartProcessWaitForExit(wp_BatFile As String)
Dim p As System.Diagnostics.Process = System.Diagnostics.Process.Start(wp_BatFile)
p.WaitForExit()
p.Close()
p.Dispose()
End Sub
Private Sub ms_StartProcess(wp_File As String)
Dim p As System.Diagnostics.Process = System.Diagnostics.Process.Start(wp_File)
End Sub
Private Function mf_GetFileText(wp_TxtFile As String) As String
Dim ret As String = ""
Dim enc As System.Text.Encoding = System.Text.Encoding.GetEncoding("shift_jis")
Dim sr As New System.IO.StreamReader(wp_TxtFile, enc)
ret = sr.ReadToEnd()
sr.Close()
Return ret
End Function
Private Function mf_FileTextToStringList(wp_FileText As String) As List(Of String)
Dim ret As New List(Of String)
Dim a As String() = Split(wp_FileText, vbCrLf, -1, CompareMethod.Text)
For i As Integer = 0 To a.Count - 1
Dim w As String = a(i).Trim
If w <> "" Then
If Not mf_Header(w) Then
If Not mf_Separator(w) Then
ret.Add(w)
End If
End If
End If
Next
Return ret
End Function
Private Function mf_Header(wp_String As String) As Boolean
Dim ret As Boolean = False
Dim w As String = wp_String.Replace(" ", "")
If w.Trim = "名前NULL?型" Then
ret = True
End If
Return ret
End Function
Private Function mf_Separator(wp_String As String) As Boolean
Dim ret As Boolean = False
Dim w As String = wp_String.Replace("-", "")
If w.Trim = "" Then
ret = True
End If
Return ret
End Function
Private Function mf_StringListToDescList(wp_StringList As List(Of String)) As List(Of clsDesc)
Dim ret As New List(Of clsDesc)
For i As Integer = 0 To wp_StringList.Count - 1
Dim w_input As String = wp_StringList(i)
Dim w_pattern As String = " +"
Dim w_replacement As String = vbTab
Dim w As String = Regex.Replace(w_input, w_pattern, w_replacement, RegexOptions.Multiline Or RegexOptions.IgnoreCase)
Dim a As String() = Split(w, vbTab, -1, CompareMethod.Text)
Select Case a.Count
Case 2
Dim w_Desc As New clsDesc()
w_Desc.c0Name = a(0)
w_Desc.c2Type = a(1)
ret.Add(w_Desc)
Case 3
Dim w_Desc As New clsDesc()
w_Desc.c0Name = a(0)
w_Desc.c1Null = a(1)
w_Desc.c2Type = a(2)
ret.Add(w_Desc)
Case Else
End Select
Next
Return ret
End Function
Private Function mf_ObjectToString(wp_Object As Object) As String
Dim ret As String = ""
If Not wp_Object Is Nothing Then
ret = wp_Object.ToString
End If
Return ret
End Function
Private Sub ms_DelFile(wp_File As String)
System.IO.File.Delete(wp_File)
End Sub
End Class
mdlInit.vb
Imports System.Runtime.InteropServices
Module mdlInit
<DllImport("KERNEL32.DLL", CharSet:=CharSet.Auto)> _
Public Function GetPrivateProfileString( _
ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As System.Text.StringBuilder, _
ByVal nSize As Integer, _
ByVal lpFileName As String) As Integer
End Function
<DllImport("KERNEL32.DLL")> _
Public Function WritePrivateProfileString( _
ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpString As String, _
ByVal lpFileName As String) As Integer
End Function
Public Function pf_GetIni(ByVal wp_path As String, ByVal wp_section As String, ByVal wp_key As String, ByVal wp_Default As String) As String
Dim ret As String = wp_Default
Dim sb As New System.Text.StringBuilder
sb.Capacity = 256
Dim i As Integer = GetPrivateProfileString(wp_section, wp_key, wp_Default, sb, sb.Capacity, mf_path(wp_path))
ret = sb.ToString
Return ret
End Function
Public Sub ps_PutIni(ByVal wp_path As String, ByVal wp_section As String, ByVal wp_key As String, ByVal wp_value As String)
Dim i As Integer = WritePrivateProfileString(wp_section, wp_key, wp_value, mf_path(wp_path))
End Sub
Private Function mf_path(ByVal wp_path As String) As String
Dim ret As String = wp_path
If ret = "" Then
Dim w_path As String = Application.StartupPath
If w_path.EndsWith("\") = False Then
w_path = w_path & "\"
End If
ret = String.Format("{0}{1}.ini", w_path, My.Application.Info.AssemblyName)
End If
Return ret
End Function
End Module
sb.vb
Public Class sb
Private m_sb As System.Text.StringBuilder
Public Sub New()
m_sb = New System.Text.StringBuilder()
End Sub
Public Overrides Function ToString() As String
Return m_sb.ToString()
End Function
Public Function Add(ByVal wp_String As String, ByVal ParamArray wp_Args() As Object)
m_sb.AppendFormat(wp_String, wp_Args)
m_sb.Append(ControlChars.CrLf)
Return m_sb
End Function
Public Function ToStringRemoveLastCrLf() As String
Dim ret As String = m_sb.ToString
If ret.Length >= vbCrLf.Length Then
Dim i As Integer = ret.Length - vbCrLf.Length
Dim w As String = ret.Substring(i)
If w = vbCrLf Then
ret = ret.Substring(0, i)
End If
End If
Return ret
End Function
Public Sub cb()
Clipboard.SetText(m_sb.ToString())
End Sub
End Class
最終更新:2018年02月22日 21:14