惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
月光博客
月光博客
爱范儿
爱范儿
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
腾讯CDC
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
U
Unit 42
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
L
LangChain Blog

博客园 - yiyanxiyin

一个linq左连接查询速度问题 利用vba实现excel表格连接打印编号(一页两个编号),编号支持前缀 使用反射让linq实现动态查询, 类似拼接sql语句的where 条件 中断工作流并持久化到数据库中【源码】 按模板生成word报表,可扩展,demo可生成多页 在非asp.net程序中使用缓存 固定table的行列 固定table的cell宽度,多余的文字隐藏 - yiyanxiyin - 博客园 wcf中异步与双向通讯的区别 解决msmq私有队列不能持久保存的问题 sqlserver中使用查询分析器的一点小技巧 Response.Redirect()与Server.Transfer()的区别 cellIndex在隐藏td中的问题,bug?(ie6) - yiyanxiyin - 博客园 一个format格式问题 - yiyanxiyin - 博客园 参透js 搞不懂的js 个人作品:全文搜索Access中的数据(附.net源代码) 个人作品:存储过程代码生成器(for MS SQL Server) 原创技术文章:保存帐号信息通用类(使用Session或者Cookie)
原创:一个相当有用的宏(for vs.net),该宏能大大的提高开...
yiyanxiyin · 2007-06-26 · via 博客园 - yiyanxiyin

下面的宏用于将剪贴板里面的url指定的文件在vs.net中打开以便编辑,目的是提高打开文件的速度
比如:你在ie中运行一个系统时,某一个页面有错,这个时候你需要修改这个页面,那么你只需要复制该页面的url,然后到vs.net中使用一个运行宏的快捷键就可以打开修改该页面了(最好事先打开了解决方案,这样该文件是作为解决方案中的一个文件打开的,而不是一个单独的与项目无关的文件)。如果不使用宏你将不得不打开解决方案资源管理器,一层一层的展开树,然后找到要修改的文件

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"
            VirtualName 
= LCase(VirtualName) ' added 2008-4-2
            Dim pos = InStr(LCase(ClipString), "/" & VirtualName & "/")
            
If (pos = 0Then
                pos 
= InStr(LCase(ClipString), "\" & VirtualName & "\")
            
End If
            
If (pos <> 0Then
                ClipString 
= Right(ClipString, Len(ClipString) - pos - Len("\" & VirtualName & "\"+ 1)
            
End If
            pos 
= InStr(ClipString, "?")
            
If (pos <> 0Then
                ClipString 
= Left(ClipString, pos - 1)
            
End If
            
'组合成正确的物理路径
            ClipString = "E:\科信施工项目成本管理系统\" & 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