vb.net搜索关键字 vb文件搜索器

ASP.net(vb.net)用gridview显示关键字查询内容可以这样做啊 。button单击事件里边获取textbox的值,传回到数据库
sql语句如下
select
*
from
表名
where
匹配的列
like
'%参数%'
得到的结果就是包含查询内容的所有结果了
vb.net怎么找doc中关键字的在第几页,, , ,,,, ,  。。。。。。。。??????????。。。。。。。。?
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
【vb.net搜索关键字 vb文件搜索器】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关键字搜索文件窗体上添加一个文本框,一个列表框,一个按钮:
代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyDir As String = "C:\123"
Dim MyFilter As String = "*"TextBox1.Text"*"
ListBox1.Items.Clear()
For Each MyFile As String In System.IO.Directory.GetFiles(MyDir, MyFilter)
ListBox1.Items.Add(MyFile)
Next
End Sub
关于vb.net搜索关键字和vb文件搜索器的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读