获取方法的名称和行数 [英] Get Method name and Line count for the method

查看:68
本文介绍了获取方法的名称和行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个文件夹中提供了cs文件列表.
我想获取每个cs文件中可用的类名称,方法名称和方法的行数的列表.

请帮助我.

I have list of cs file available in one folder.
I want to get the list for class name, method name and line count of the method available in each cs file.

Please help me.

推荐答案

然后您将不得不解析文件并提取信息.
这并不简单:您必须相当仔细地处理文件,以确保遇到"{"或}"时,它是语句的一部分,而不是字符或字符串定义或注释.
Then you are going to have to parse the files, and extract the information.
This is not trivial: You have to process the file fairly carefully to ensure that when you encounter a ''{'' or ''}'' it is part of a statement, and not a character or string definition, or comment.


这篇关于获取方法的名称和行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆