顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


文章 - gill7892001

頁: [1]
1
請問一下,使用vb.net要怎麼在檔案的某行內取某些字元做全形或半形的轉換呢?
例如:
第一行的前8個半形字要轉成全形...此程式該如何寫?

2
以下是一個跑外字的程式,但是有點問題,跑不出來能不能幫我找一下那裡錯了^^"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Readfile As New System.IO.StreamReader("c:\kau.txt", System.Text.Encoding.GetEncoding("BIG5"))
Dim Writefile As New System.IO.StreamWriter("c:\ss.txt")
Dim Writefile1 As New System.IO.StreamWriter("c:\ss1.txt")
Dim k(10) As String
Dim f(10) As String
Do
k(10) = Readfile.ReadLine()
f(10) = StrConv(k(10), VbStrConv.Wide)

Loop Until Readfile Is Nothing


Dim i As Integer
f(2) = 0
f(9) = 0
f(1) = Len(k(1))
For i = 1 To f(1)
f(2) = f(2) + 1
k(3) = Mid$(k(1), f(2), 1)
f(10) = (Asc(k(3)))
Select Case f(10)
Case -1472 To -258, -29120 To -24322, -32448 To -29186, -14687 To -14082
f(9) = f(9) + 1
Case Else
f(9) = f(9)
End Select
Next i
If f(9) > 0 Then

Writefile.WriteLine(f(9))
Console.WriteLine()

Else
Writefile.WriteLine(f(9))
Console.WriteLine()
End If
Readfile.Close()
Writefile.Close()
End Sub

頁: [1]