
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.Threading
Public Module QuickFindPage
Dim ClipString As String
Sub QuickFindPage()
'// take whatever is on the clipboard and save it to an xml file
'// intended for cut & paste from QueryAnalyzer
Dim ClipBoardThread As System.Threading.Thread = New System.Threading.Thread(AddressOf getClipString_core)
With ClipBoardThread
.ApartmentState = ApartmentState.STA
.IsBackground = True
.Start()
'-- Wait for copy to happen
.Join()
End With
ClipBoardThread = Nothing
ClipString = Replace(ClipString, "/", "\")
If ClipString <> "" Then
If System.IO.File.Exists(ClipString) Then
DTE.ItemOperations.OpenFile(ClipString)
Else
Dim posControl = InStr(ClipString, ".ascx")
Dim posControl2 = InStr(ClipString, ".aspx")
If (posControl <> 0) Then
Dim ClipString1 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\CO\Control\" & ClipString
Dim ClipString2 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\PO\Control\" & ClipString
Dim ClipString3 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\IV\Control\" & ClipString
Dim ClipString4 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\IN\Control\" & ClipString
Dim ClipString5 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\SH\Control\" & ClipString
If System.IO.File.Exists(ClipString1) Then
DTE.ItemOperations.OpenFile(ClipString1)
ElseIf System.IO.File.Exists(ClipString2) Then
DTE.ItemOperations.OpenFile(ClipString2)
ElseIf System.IO.File.Exists(ClipString3) Then
DTE.ItemOperations.OpenFile(ClipString3)
ElseIf System.IO.File.Exists(ClipString4) Then
DTE.ItemOperations.OpenFile(ClipString4)
ElseIf System.IO.File.Exists(ClipString5) Then
DTE.ItemOperations.OpenFile(ClipString5)
Else
MessageBox.Show("Can not find the file !")
End If
ElseIf (posControl2 <> 0) Then
Dim ClipString1 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\CO\Page\" & ClipString
Dim ClipString2 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\PO\Page\" & ClipString
Dim ClipString3 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\IV\Page\" & ClipString
Dim ClipString4 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\IN\Page\" & ClipString
Dim ClipString5 = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\SH\Page\" & ClipString
If System.IO.File.Exists(ClipString1) Then
DTE.ItemOperations.OpenFile(ClipString1)
ElseIf System.IO.File.Exists(ClipString2) Then
DTE.ItemOperations.OpenFile(ClipString2)
ElseIf System.IO.File.Exists(ClipString3) Then
DTE.ItemOperations.OpenFile(ClipString3)
ElseIf System.IO.File.Exists(ClipString4) Then
DTE.ItemOperations.OpenFile(ClipString4)
ElseIf System.IO.File.Exists(ClipString5) Then
DTE.ItemOperations.OpenFile(ClipString5)
Else
MessageBox.Show("Can not find the file !")
End If
Else
'虚拟目录名()
Dim VirtualName = "Rhombus2_YEA"
Dim pos = InStr(ClipString, "\" & VirtualName & "\")
If (pos <> 0) Then
ClipString = Right(ClipString, Len(ClipString) - pos - Len("\" & VirtualName & "\") + 1)
End If
pos = InStr(ClipString, "?")
If (pos <> 0) Then
ClipString = Left(ClipString, pos - 1)
End If
'组合成正确的物理路径
ClipString = "D:\Rhombus2\2-Software Development\4-Software Implementation\2-Source Files\Source DEV\RhombusSolution\Rhombus2\" & ClipString
If System.IO.File.Exists(ClipString) Then
DTE.ItemOperations.OpenFile(ClipString)
Else
MessageBox.Show("Can not find the file !")
End If
End If
End If
End If
End Sub
Sub getClipString_core()
ClipString = Clipboard.GetDataObject().GetData(System.Windows.Forms.DataFormats.StringFormat)
End Sub
End Module
2、多行查找:






























































































































































































































































































