Dim instance As StdFunc = New StdFunc() Dim filePathName As String 'ファイルのフルパス Dim value As String '書き出す文字列 Dim returnValue As Boolean '成功:True 失敗:False 'Overloads returnValue = instance.FileWrite(filePathName, value) 'エンコードを指定しない場合はUTF-8
Dim instance As StdFunc = New StdFunc() Dim filePathName As String 'ファイルのフルパス Dim value As String '書き出す文字列 Dim encodeStr As String 'エンコードを表す文字列 "utf8" "shift_jis" "iso-2022-jp" "euc-jp" Dim returnValue As Boolean '成功:True 失敗:False 'Overloads returnValue = instance.FileWrite(filePathName, value, encodeStr)
Dim instance As StdFunc = New StdFunc() Dim filePathName As String 'ファイルのフルパス Dim value As String '書き出す文字列 Dim encode As System.Text.Encoding 'エンコード Dim returnValue As Boolean '成功:True 失敗:False 'Overloads returnValue = instance.FileWrite(filePathName, value, encode)
'StdFuncクラス FileWriteメソッド
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Public Class AddIn
Private stdf As StdFunc
Public Sub New()
stdf = New StdFunc()
End Sub
Public Sub AddIn_Start()
Dim fname As String = "D:\tmp\output.txt"
Dim str As String = "Hello World" & ControlChars.CrLf & "こんにちは"
If stdf.FileWrite(fname, str) Then
MessageBox.Show("書き出しに成功しました")
Else
MessageBox.Show("書き出しに失敗しました")
End If
End Sub
End Class
'StdFuncクラス FileWriteメソッド
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Public Class AddIn
Private stdf As StdFunc
Public Sub New()
stdf = New StdFunc()
End Sub
Public Sub AddIn_Start()
Dim fname As String = "D:\tmp\output.txt"
Dim str As String = "Hello World" & ControlChars.CrLf & "こんにちは"
If stdf.FileWrite(fname, str, "euc-jp") Then
MessageBox.Show("書き出しに成功しました")
Else
MessageBox.Show("書き出しに失敗しました")
End If
End Sub
End Class
'StdFuncクラス FileWriteメソッド
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Public Class AddIn
Private stdf As StdFunc
Public Sub New()
stdf = New StdFunc()
End Sub
Public Sub AddIn_Start()
Dim fname As String = "D:\tmp\output.txt"
Dim str As String = "Hello World" & ControlChars.CrLf & "こんにちは"
If stdf.FileWrite(fname, str, System.Text.Encoding.GetEncoding(932)) Then
MessageBox.Show("書き出しに成功しました")
Else
MessageBox.Show("書き出しに失敗しました")
End If
End Sub
End Class
このページのQRコード
便利ウェブサイト
便利 Steam アプリ
便利 Android アプリ