RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
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查找字符串位置
文章来源:http://scyingshan.cn/article/dddgpcp.html