Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- using System.Collections;
- namespace MetricTool
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- }
- public void cWeight()
- {
- var content = File.ReadAllLines(@"C:\Users\Maheshi\Desktop\Tool\" + textBox1.Text + ".txt"); //select the content line by line
- foreach (string line in content) //foreach line
- {
- char[] separators = { ' ', '\t' };
- var words = line.Split(separators, StringSplitOptions.RemoveEmptyEntries); //split into words
- int len = words.Length;
- int j = 0;
- while (j < len) //check each word in the line
- {
- string word = words[j];
- if ((word == "public") || (word == "private") || (word == "protected"))
- {
- string nxtword = words[j + 1];
- if (nxtword != "class")
- {
- if ((word == "int") || (word == "double") || (word == "byte") || (word == "bool") || (word == "char") || (word == "float") || (word == "long") || (word == "short") || (word == "signed") || (word == "unsigned") || (word == "void"))
- {
- string methodName = words[j + 1];
- ArrayList mNames = new ArrayList();
- mNames.Add(methodName);
- do
- {
- }
- while (methodName != methodName);
- }
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment