小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

一個(gè)相當(dāng)有用的宏(for vs.net),該宏能大大的提高開發(fā)速度

 odz521 2007-06-26

 

面的宏用于將剪貼板里面的url指定的文件在vs.net中打開以便編輯,目的是提高打開文件的速度
比如:你在ie中運(yùn)行一個(gè)系統(tǒng)時(shí),某一個(gè)頁面有錯(cuò),這個(gè)時(shí)候你需要修改這個(gè)頁面,那么你只需要復(fù)制該頁面的url,然后到vs.net中使用一個(gè)運(yùn)行宏的快捷鍵就可以打開修改該頁面了(最好事先打開了解決方案,這樣該文件是作為解決方案中的一個(gè)文件打開的,而不是一個(gè)單獨(dú)的與項(xiàng)目無關(guān)的文件)。如果不使用宏你將不得不打開解決方案資源管理器,一層一層的展開樹,然后找到要修改的文件

Imports EnvDTE
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.Threading

Public Module RecordingModule
    Dim ClipString As String
    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()
        End With
        ClipBoardThread = Nothing
        If ClipString <> "" Then
            ‘虛擬目錄名()
            Dim VirtualName = "kxframework"
            Dim pos = InStr(LCase(ClipString), "/" & VirtualName & "/")
            If (pos = 0) Then
                pos = InStr(LCase(ClipString), "\" & VirtualName & "\")
            End If
            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 = "E:\科信施工項(xiàng)目成本管理系統(tǒng)\" & VirtualName & "\" & ClipString
            ClipString = Replace(ClipString, "/", "\")
            If System.IO.File.Exists(ClipString) Then
                DTE.ItemOperations.OpenFile(ClipString)
            Else
                MessageBox.Show("文件(" & ClipString & ")未找到!")
            End If
        End If
    End Sub
    Sub getClipString_core()
        ClipString = Clipboard.GetDataObject().GetData(System.Windows.Forms.DataFormats.StringFormat)
    End Sub
End Module

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多