Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,025

HOME > ASP.NET > ASP.NET File/Folder Object > ASP.NET Search & Highlight Text file



Clound SSD Virtual Server

ASP.NET Search & Highlight Text file

ASP.NET Search & Highlight Text files เป็นการค้นหาข้อความ และ Highlight ใน Text Files นำผลลัพธ์ที่ได้แสดงบนเว็บไซต์

Language Code : VB.NET || C#

Framework : 1,2,3,4


AspNetSearchTextFiles2.aspx

<%@ Import Namespace="System.IO"%>
<%@ Page Language="VB" %>
<script runat="server">
    Sub Page_Load(sender As Object, e As EventArgs)		
		Dim StrWer  As StreamReader
		Dim StrBui As StringBuilder
		Dim strLine As String

		Dim SearchText As String = "2008"
		Dim intLine As Integer
		Dim strNum As String

		StrWer  = File.OpenText(Server.MapPath("MyFiles/") & "thaicreate.txt")
		StrBui = New StringBuilder()

		Do Until StrWer.EndOfStream
			intLine = intLine + 1
			strLine = StrWer.ReadLine()
			If InStr(strLine, SearchText) > 0 Then
				strLine = Replace(strLine, SearchText, _
					"<span style=""background-color:red;"">" & SearchText & "</span>")
				strNum = strNum & intLine & ","
			End If
			StrBui.AppendLine(strLine & "<br>")
		Loop
		
		Me.lblText1.Text = StrBui.ToString()
		Me.lblText2.Text = "Found Line : " &strNum.ToString

		StrBui = Nothing
		StrWer.Close()

    End Sub
</script>
<html>
<head>
<title>ThaiCreate.Com ASP.NET - Search Text Files</title>
</head>
<body>
    <form runat="server">
	<asp:Label id="lblText1" runat="server"></asp:Label><br />
	<asp:Label id="lblText2" runat="server"></asp:Label><br />
    </form>
</body>
</html>


Screenshot

ASP.NET Search Text Files

ASP.NET Search Text Files






   
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2008-11-29 21:07:47 / 2009-06-03 07:48:01
  Download : Download  ASP.NET Search & Highlight Text file
 Sponsored Links / Related

 
ASP.NET Create Text File
Rating :

 
ASP.NET Delete File
Rating :

 
ASP.NET Write Text File
Rating :

 
ASP.NET Create/Delete Folder
Rating :

 
ASP.NET Open Text File
Rating :

 
ASP.NET Read Text File
Rating :

 
ASP.NET List File in Directory
Rating :

 
ASP.NET List Folder (List Directory)
Rating :

 
ASP.NET Search Text file
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่