作者YamaToma (山斗王道)
看板Visual_Basic
标题[.NET] 翻译机程式
时间Sun Jun 7 18:42:42 2009
请输入专案类型(网站专案或者应用程式专案):
我要写一个可以翻译句子的程式,我写到它可以Load我给他的.txt档,
可是下面我就写不出来了,我不知道怎麽让它翻译出来。
请大家帮帮我。
这是我现在写的程式,感觉也有一点怪怪的。
Public Class Form1
Dim file As String
Dim filename As String
Dim linenum As Integer = 1
Dim tmp1() As String
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As String
x = TextBox1.Text
Dim sr As New IO.StreamReader(file)
Dim str As String = ""
While Not sr.EndOfStream
linenum += 1
str = str & sr.ReadLine & " "
End While
tmp1 = Split(Trim(str), " ")
TextBox2.Text = str
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OpenFileDialog1.Filter = "纯文字(*.txt)|*.txt|Rich Text 文件(*.RTF)|*.RTF"
OpenFileDialog1.FileName = "JVA04.txt"
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
file = OpenFileDialog1.FileName
filename = My.Computer.FileSystem.GetName(file)
End If
End Sub
End Class
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.187.77.51
1F:→ meconin:所以你的问题是 ... 06/07 19:00
2F:→ sosokill:你需要一个字典来对照= = 06/07 22:03
3F:→ Love1019:或是你import Net 抓网路字典程式吧 = =+ 06/08 02:00
4F:→ horngsh:要先有好的演算法, 不要design on fly. 06/08 09:55