如何在Windows中从.cs检索方法正文? [英] How to retrive method body from .cs in Windows?

查看:78
本文介绍了如何在Windows中从.cs检索方法正文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!这是Hemanth.我有一个要求,我需要从.cs文件中找到方法主体.
我将使用OpenDialog控件选择文件.

例如,我有一个名为"Employee.cs"的文件.在此文件中,我有两个方法,它们也读取了具有返回类型,输入参数和方法主体的每个方法,并显示在列表框中.

Hello everyone!This is Hemanth.I have a requirement that i need to find the method body from the .cs file.
I will select the file using OpenDialog control.

For example i have a file called "Employee.cs".In this File i have two methods which i have the read the each method with return type ,input parameters and Method body too and display in a listbox.

推荐答案

将其读取为纯文本文件:您知道方法从何处开始,以便可以弄清楚方法从何处结束(或者,下一个方法从何处开始),然后显示两者之间的所有内容.

我想这是另一个操作员问的同样的作业吗?
Read it as a plain text file: you know where a method starts so you can work out where it ends (or, perhaps, where the next method begins) and then display everything in between.

I presume this is the same bit of homework that the other op has asked about?


这篇关于如何在Windows中从.cs检索方法正文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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