比较 Visual-studio 2010 上的两个函数调用图
在我的情况下,我想找出包含此函数调用的所有函数
DBase.CreateCommand();
以下调用
DBase.CloseCommand(cmd);
,但不包括该函数中的
。我想做的是找出任何未关闭的数据库连接。
工具、插件、正则表达式等都是受欢迎的。
In my situation, I would like to find out all the functions containing this function call
DBase.CreateCommand();
But not include the following call
DBase.CloseCommand(cmd);
In that function.
What I'm trying to do is to find out any not closed database connections.
A tool, plugin, regex etc. are all welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将方法的名称:
CreateCommand()
更改为不同的名称,这样您在编译时会收到一堆错误,您将一一检查这些错误?或者您可以通过精确匹配进行搜索:
"CreateCommand();"
或在 Visual Studio 中,右键单击该方法,然后选择查找所有引用...You can change the name of the method:
CreateCommand()
into a different name so you will get a bunch of errors at compile time and you will check those errors one by one?or you can search by exact match:
"CreateCommand();"
or in Visual Studio, right click on the method then select Find All References...您可以尝试 Resharper 或类似的东西 - 虽然不提供比较(据我所知),但它将使它们更容易修改,因为更改会产生连锁反应,而且它有很多简洁的工具。除非 Fortify 扫描或其他代码分析工具获取未发布的资源,例如 dbconns 和 reader 等,尽管我相信它们可能相当昂贵!
You could try Resharper or something like that - whilst not providing a compare (that I know of) it will make them easier to modify as changes will ripple though and it has a lot of neat tools. Barring that Fortify scanning or other code analysis tools pick up un-released resources such as dbconns, and readers ect as well although I believe they may be quite pricey!