vb.net查找错字 vb查找字符串位置

怎么编制vb程序快速的查找文中的错别字

1、找一份词库

成都创新互联公司长期为数千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为梅县企业提供专业的网站设计制作、成都做网站梅县网站改版等技术服务。拥有10余年丰富建站经验和众多成功案例,为您定制开发。

2、在“文中”进行分词、匹配

.net和java都有比较成熟的分词和词库,vb实现比较费时

VB查找关键字

Dim number As Long

Private Function FindStr(ByVal SLeft As Long, ByVal SFind As String, ByVal SSFind As String)

If Len(SFind) Len(SSFind) - SLeft Then

FindStr = -1

Exit Function

Else

FindStr = InStr(SLeft + 1, SSFind, SFind) - 1

End If

End Function

Private Sub Command1_Click()

number = FindStr(0, Text1.Text, RichTextBox1.Text)

If number = -1 Then

MsgBox "没有找到"

Command2.Enabled = False

Else

RichTextBox1.SelStart = number

RichTextBox1.SelLength = Len(Text1.Text)

Command2.Enabled = True

End If

End Sub

Private Sub Command2_Click()

number = FindStr(number + Len(Text1.Text), Text1.Text, RichTextBox1.Text)

If number = -1 Then

MsgBox "查找完毕"

Command2.Enabled = False

Else

RichTextBox1.SelStart = number

RichTextBox1.SelLength = Len(Text1.Text)

Command2.Enabled = True

End If

End Sub

注意RichTextBox1.HideSelection要设为false

vb.net DataGridView关于查找问题

遍历datagridview的单元格,判断单元格内的值是否与textbox的text相等。

foreach (DataGridViewRow row in dataGridView1.Rows)

{

foreach(DataGridViewCell cell in row)

{

if(cell.value = textbox1.text) then

cell.focus()

else

msg("没有找到相关信息")

}

}

在VB.NET中怎么用InputBox实现查找功能

dim str1 ,str2 as string

dim n as integer

str2=inputbox("请输入要查找的字符:")

for n=1 to len(textbox1.text)

str1=mid(textbox1.text,n,1)

if str2=str1 then

msgbox("找到啦!")

exit for

end if

next

if n=len(textbox1.text)+1 then

msgbox("没有你要找的字符!")

end if


当前标题:vb.net查找错字 vb查找字符串位置
链接URL:http://bzwzjz.com/article/dddgpcp.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站设计 营销型网站建设 移动手机网站制作 公司网站建设 成都网站设计 成都网站建设 网站制作 成都网站制作 网站建设 成都定制网站建设 重庆网站建设 成都网站建设 定制网站设计 成都网站建设 成都网站建设 成都网站制作 温江网站设计 成都网站制作 重庆企业网站建设 响应式网站设计 成都网站设计公司 LED网站设计方案