下関側からの関門海峡の夜景。
The night view of the KANMON straits from the Shimonoseki side.
関門海峡の夜景 – The night view of the KANMON straits
下関側からの関門海峡の夜景。 The night view of the KANMON straits from the Shimonoseki side.
下関側からの関門海峡の夜景。 The night view of the KANMON straits from the Shimonoseki side.
いつもは百舌鳥が来てなくアンテナに、雀が来て鳴いていた。風に向かって胸を張って、なぜか威張っている。
いよいよWindows7が発売!!。その価格は...。14,000円前後?。
いよいよWindows7が発売!!。その価格は...。14,000円前後?。
Windows7 Tomorrow launch
Windows7 Tomorrow launch
角島には灯台がある。昼間は結構観光の人でにぎあうが、夕方暗くなると人も余り来なくなる。灯台の光だけがあたりを照らす。
モズが最近来るようになった。モズはいろいろな声で鳴くので面白い。百舌鳥と書く訳だ。 A shrike(butcherbird) sometimes comes. It has various voices. The sh … “秋の使者モズ – An autumn messenger shrike” の続きを読む
牧崎から日本海を望む 西長門リゾートの教会と海岸
久しぶりに八景水谷に行った。 かわせみはいなかったが、白鷺やアヒル、セキレイなどがいた。 キセキレイ – Yellow Wagtail アヒル – Ducks are marching おめかし中 … “鳥 – bird” の続きを読む
最新のPhotoShopが欲しいと思いだした。最初3から始まって、4、5.5とアップグレードしてきたが、最新のCS4ではアップグレードが届かなくなってしまった。もうすぐCS5が出るらしい。CS5は色々とすごい機能があるよ … “PhotoShopが欲しい” の続きを読む
最新のPhotoShopが欲しいと思いだした。最初3から始まって、4、5.5とアップグレードしてきたが、最新のCS4ではアップグレードが届かなくなってしまった。もうすぐCS5が出るらしい。CS5は色々とすごい機能があるようだが、どれほど使うかなと考えた。しかも高そうだ。そこでPhotoShopElementsの購入を考えた。これだと安いし、もし、あとでCS5が欲しくなっても、アップグレードできる。今の最新バージョンは8のようだ。早速体験版をダウンして使ってみていている。頻繁に使う機能は、Elementsにも入っていて、普通に使える。これでもいいかなあ。しかも、Premiere Elements 8とセットのものまである。これはいい。セットでも2万円を切っている。
Readボタンを押すと、テキストファイルを読んでListBoxに表示します。また、ピクチャボックスにも表示します。Writeボタンを押すと、ListBoxの内容を、テキストファイルへ出力します。 フォーム1 Public … “テキストファイルの読み書き” の続きを読む
Readボタンを押すと、テキストファイルを読んでListBoxに表示します。また、ピクチャボックスにも表示します。
Writeボタンを押すと、ListBoxの内容を、テキストファイルへ出力します。
フォーム1
Public Class Form1
ボタン1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
’ファイルIO用の変数等の宣言
Dim fname As String
Dim ret As DialogResult
Dim TextFile As IO.StreamReader
Dim Line As String
Dim cnt As Integer
’PictureBox1のGraphicsオブジェクトを取得
Dim g As Graphics = PictureBox1.CreateGraphics()
Dim ystr As Integer
‘ダイアログボックスの初期設定
With Me.OpenFileDialog1
.Title = “ファイルを開く”
.CheckFileExists = True
.RestoreDirectory = True
.Filter = “テキストファイル|.txt;.dat”
.FileName = “test.txt”
End With
‘ダイアログボックスの表示
ret = Me.OpenFileDialog1.ShowDialog()
If ret = Windows.Forms.DialogResult.OK Then
fname = Me.OpenFileDialog1.FileName
Else
fname = “”
End If
If IO.File.Exists(fname) = False Then
MessageBox.Show(“ファイルが見つかりません。”, “通知”)
Exit Sub
End If
‘フォントオブジェクトの作成
Dim fnt As New Font(“MS UI Gothic”, 12)
Me.ListBox1.Items.Clear()
TextFile = New IO.StreamReader(fname, System.Text.Encoding.Default)
cnt = 0
Do While True
Line = TextFile.ReadLine()
If Line = Nothing Then
Exit Do
End If
Me.ListBox1.Items.Add(Line)
cnt = cnt + 1
‘文字列を位置(0,0)、青色で表示
g.DrawString(Line, fnt, Brushes.Blue, 0, ystr)
ystr = ystr + 20
Loop
TextFile.Close()
‘リソースを開放する
fnt.Dispose()
g.Dispose()
Label2.Text = cnt.ToString
End Sub
ボタン2
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim ret As DialogResult
Dim textfile As IO.StreamWriter
Dim i As Integer
Dim cnt As Integer
cnt = Integer.Parse(Label2.Text)
‘ダイアログボックスの初期設定
With Me.SaveFileDialog1
.RestoreDirectory = True
.OverwritePrompt = True
.Filter = “すべてのファイル(.)|.|” & “テキストファイル(.txt)|.txt”
.FileName = “ts.txt”
End With
‘ダイアログボックスの表示
ret = Me.SaveFileDialog1.ShowDialog
If ret = Windows.Forms.DialogResult.OK Then
Me.Label1.Text = Me.SaveFileDialog1.FileName
‘現在のファイルのエンコーディングで出力
‘textfile = New IO.StreamWriter(Me.Label1.Text, False, System.Text.Encoding.Default)
‘エンコーディングをShift-JISに指定する
textfile = New IO.StreamWriter(Me.Label1.Text, False, System.Text.Encoding.GetEncoding(\”Shift-JIS\”))
For i = 1 To ListBox1.Items.Count
‘Me.ListBox1.s = i – 1
textfile.WriteLine(Me.ListBox1.Items(i – 1))
Next
textfile.Close()
End If
End Sub
End Class