资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vb.net背单词 vba单词

用VB语言制作英汉小辞典

Public Class Form1

在克拉玛依等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站制作、网站建设 网站设计制作按需求定制设计,公司网站建设,企业网站建设,品牌网站设计,成都全网营销,成都外贸网站建设,克拉玛依网站建设费用合理。

Inherits System.Windows.Forms.Form

Public filename As String = "英汉词典.txt"

Public myword(6500, 1) As String

Public words As Integer = 0

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim a As String

Dim b As Integer

Dim i As Integer = 0

Dim n As String

Dim m As String

Dim stringb As Integer

TextBox1.Text = ""

TextBox2.Text = ""

FileOpen(1, "英汉词典.txt", OpenMode.Input)

Do While Not EOF(1)

a = LineInput(1)

b = InStr(a, " ")

n = Microsoft.VisualBasic.Left(a, b - 1)

myword(i, 0) = n

ListBox1.Items.Add(n)

stringb = Len(a) - b

m = Trim(Microsoft.VisualBasic.Right(a, stringb))

myword(i, 1) = m

i += 1

Loop

words = i

FileClose(1)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim i As Integer = -1

If TextBox1.Text = "" Then

MessageBox.Show("不能输入空格,请重新输入")

TextBox2.Text = ""

TextBox1.Focus()

Exit Sub

Else

For i = i + 1 To words

If LCase(TextBox1.Text) = LCase(myword(i, 0)) Then

TextBox2.Text = Trim(myword(i, 1))

Exit Sub

End If

Next

MessageBox.Show(" 您需要的单词不存在,请重新输入")

End If

End Sub

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

Try

TextBox1.Text = myword(ListBox1.SelectedIndex, 0)

TextBox2.Text = Trim(myword(ListBox1.SelectedIndex, 1))

Catch ex As Exception

End Try

Exit Sub

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Dim ch, enterwords As String

Dim j, m As Integer

If -1 = ListBox1.SelectedIndex Then

MsgBox("请选择单词", , "")

ListBox1.Focus()

Exit Sub

End If

enterwords = InputBox("请修改单词", "修改单词", Trim(myword(ListBox1.SelectedIndex, 0)))

Do While enterwords = ""

m = MsgBox("单词不能为空", MsgBoxStyle.RetryCancel, "修改单词")

If m = 4 Then

enterwords = InputBox("请修改单词", "修改单词", Trim(myword(ListBox1.SelectedIndex, 0)))

Else

Exit Sub

End If

Loop

ch = InputBox("请修改中文意思", "修改单词", Trim(myword(ListBox1.SelectedIndex, 1)))

Do While ch = ""

m = MsgBox("中文意思不能为空", MsgBoxStyle.RetryCancel, "修改单词")

If m = 4 Then

ch = InputBox("请修改中文意思", "修改单词", Trim(myword(ListBox1.SelectedIndex, 1)))

Else

Exit Sub

End If

Loop

myword(ListBox1.SelectedIndex, 1) = ch

myword(ListBox1.SelectedIndex, 0) = enterwords

FileOpen(1, filename, OpenMode.Output)

For j = 0 To words - 1

PrintLine(1, myword(j, 0) " " myword(j, 1))

Next

FileClose(1)

MsgBox("修改成功")

ListBox1.Items.Clear()

Form1_Load(sender, e)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim i As Integer = 0

Dim k, m As Integer

Dim enterwords, ch As String

enterwords = InputBox("请输入要添加的单词", "添加单词")

Do While enterwords = ""

m = MsgBox("单词不能为空,请输入单词!", MessageBoxButtons.RetryCancel, "添加单词")

If m = 4 Then

enterwords = InputBox("请输入要添加的单词", "添加单词")

Else

Exit Sub

End If

Loop

ch = InputBox("请输入中文意思", "添加中文")

Do While ch = ""

m = MsgBox("中文不能为空,请输入中文意思!", MessageBoxButtons.RetryCancel, "添加中文")

If m = 4 Then

ch = InputBox("请输入中文意思", "添加中文")

Else

Exit Sub

End If

Loop

Do While LCase(myword(i, 0)) LCase(enterwords)

i = i + 1

If words = i Then

myword(i, 0) = enterwords

myword(i, 1) = ch

words = words + 1

FileOpen(1, filename, OpenMode.Output)

For i = 0 To words - 1

PrintLine(1, myword(i, 0) " " myword(i, 1))

Next

ListBox1.Items.Clear()

FileClose(1)

ListBox1.Items.Clear()

Form1_Load(sender, e)

MessageBox.Show("添加成功")

Exit Sub

End If

Loop

If LCase(myword(i, 0)) = LCase(enterwords) Then

MessageBox.Show("该单词已存在!")

ListBox1.SelectedIndex = i

Exit Sub

ElseIf LCase(myword(0, 0)) LCase(enterwords) Then

For k = words To 0 Step -1

myword(k + 1, 0) = myword(k, 0)

myword(k + 1, 1) = myword(k, 1)

Next

myword(0, 0) = enterwords

myword(0, 1) = ch

words = words + 1

FileOpen(1, filename, OpenMode.Output)

For i = 0 To words - 1

PrintLine(1, myword(i, 0) " " myword(i, 1))

Next

ListBox1.Items.Clear()

FileClose(1)

Form1_Load(sender, e)

MessageBox.Show("添加成功")

Exit Sub

End If

For k = words To i + 1 Step -1

myword(k + 1, 0) = myword(k, 0)

myword(k + 1, 1) = myword(k, 1)

Next k

myword(i, 0) = enterwords

myword(i, 1) = ch

words = words + 1

FileOpen(1, filename, OpenMode.Output)

For i = 0 To words - 1

PrintLine(1, myword(i, 0) " " myword(i, 1))

Next

FileClose(1)

ListBox1.Items.Clear()

Form1_Load(sender, e)

MessageBox.Show("添加成功")

Exit Sub

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Dim i, j, k As Integer

If -1 = ListBox1.SelectedIndex Then

MsgBox("请选择单词", , "")

ListBox1.Focus()

Exit Sub

End If

k = MsgBox("确定是否删除", MsgBoxStyle.YesNo, "提示")

If k = 6 Then

For i = ListBox1.SelectedIndex To words

myword(i, 0) = myword(i + 1, 0)

myword(i, 1) = myword(i + 1, 1)

Next

words = words - 1

FileOpen(1, filename, OpenMode.Output)

For j = 0 To words - 1

PrintLine(1, myword(j, 0) " " myword(j, 1))

Next

FileClose(1)

MsgBox("单词已删除")

ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)

ListBox1.Refresh()

TextBox1.Text = ""

TextBox2.Text = ""

Exit Sub

Else

Exit Sub

End If

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

TextBox1.Text = ""

TextBox2.Text = ""

End Sub

End Class

这是代码,文字性的内容自己去做。

vb.net使用如密狗

加密狗怎么使用,分为以下几个步骤。

1、做加密软件之前先安装好客户端CodeMeterSDK。打开客户端,进入CodeMeter功能导航界面。

2、打开AxProtector自动加密工具。打开加密工具界面后,选择您要加密的程序类型,根据开发者软件的特点进行选择。

VB.net的快捷键

1. F12:转到定义;Shift+F12:转到引用

2. F5:启动;Ctrl+F5:开始执行(不调试);Shift+F5:停止调试

3. F7:查看代码;Shift+F7:查看视图设计器

4. Ctrl+Alt+L:解决方案资源管理器

5. Ctrl+Alt+J:对象浏览器

6. F4:显示属性窗口

7. Ctrl+Alt+X:工具箱

8. Ctrl+Alt+C类视图

9. Alt+Enter:查看属性

10.F10:逐过程调试

11.F11:逐语句调试

12.Ctrl+B:新断点

13.Ctrl+Shift+F9:清除所有断点

14.Ctrl+Shift+B生成解决方案

15.Shift+Alt+Enter:全屏

16.大纲显示:Ctrl+M, Ctrl+M:切换大纲显示展开;Ctrl+M, Ctrl+L:切换所有大纲显示;Ctrl+M,Crtl+P停止大纲显示;Ctrl+M, Ctrl+O:折叠到定义

17.智能感知:Ctrl+J:列出成员;Ctrl+Shift+空格:参数信息; Ctrl+K,Ctrl+I:快速信息;Alt+右箭头键:完成单词

VB.NET 中的sub和end sub啥意思?是什么单词的缩写?

sub一般情况下是一个英文前缀,有向下的意思,比如subway(地铁)

submarine(潜水艇)

在计算机中一般是“子……”的意思,比如SubString(子字符串),SubItems(子项)

这儿呢,sub就是指一个“子过程”,一般就简称“过程”,面向对象概念中也叫“方法”。

end

sub标志着子过程的结束,也就是说在sub与end

sub之间,就是这个子过程的内容。


文章名称:vb.net背单词 vba单词
转载来于:http://cdkjz.cn/article/dojjedc.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220