Imports EnvDTE Imports System.Diagnostics Imports System.Windows.Forms Imports System.Threading PublicModule RecordingModuleModule RecordingModule Dim ClipString AsString Sub TemporaryMacro()Sub TemporaryMacro() '// 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() EndWith ClipBoardThread =Nothing If ClipString <>""Then '虚拟目录名() Dim VirtualName ="kxframework" VirtualName =LCase(VirtualName) ' added 2008-4-2 Dim pos =InStr(LCase(ClipString), "/"& VirtualName &"/") If (pos =0) Then pos =InStr(LCase(ClipString), "\"& VirtualName &"\") EndIf If (pos <>0) Then ClipString =Right(ClipString, Len(ClipString) - pos -Len("\"& VirtualName &"\") +1) EndIf pos =InStr(ClipString, "?") If (pos <>0) Then ClipString =Left(ClipString, pos -1) EndIf '组合成正确的物理路径 ClipString ="E:\科信施工项目成本管理系统\"& VirtualName &"\"& ClipString ClipString =Replace(ClipString, "/", "\") If System.IO.File.Exists(ClipString) Then DTE.ItemOperations.OpenFile(ClipString) Else MessageBox.Show("文件("& ClipString &")未找到!") EndIf EndIf End Sub Sub getClipString_core()Sub getClipString_core() ClipString = Clipboard.GetDataObject().GetData(System.Windows.Forms.DataFormats.StringFormat) End Sub End Module
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步