程序代码
using System;
using System.Collections.Generic;using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int codelinenum = 0; //代码行数
int commentarylinenum = 0; //注释行数
int branklinenum = 0; //空行数
private void button1_Click(object sender, EventArgs e)
{
//读取指定文件
string getinfo = textBox1.Text;
StreamReader reader = new StreamReader(@getinfo, Encoding.GetEncod