源代码计算器
来源:互联网 发布:软件下载量查询 编辑:程序博客网 时间:2024/06/04 20:01
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 源代码计算器{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } int codeLineNumber = 0;//代码行数 int commentLineNumber = 0;//注释行数 int brankLineNumber = 0;//空白行数 private void btnStatistics_Click(object sender, EventArgs e) { this.Text = "源代码计算器"; string getinfo = txtPath.Text; StreamReader reader=new StreamReader(@getinfo,Encoding.GetEncoding("gb2312")); string line=reader.ReadLine(); while (line != null) { if (line.Trim() != "" && (line.Trim().StartsWith(@"//"))) { codeLineNumber++; } else if (line.Trim().StartsWith(@"//")) { commentLineNumber++; } else { brankLineNumber++; } line = reader.ReadLine(); } reader.Close(); //显示总代码行数 txttotal.Text = (codeLineNumber + commentLineNumber + brankLineNumber).ToString(); //显示代码行数 txtcode.Text = codeLineNumber.ToString(); //显示空白行数 txtbrank.Text = brankLineNumber.ToString(); //显示注释行数 txtcomment.Text = commentLineNumber.ToString(); } }}
0 0
- 计算器源代码
- 计算器源代码
- 计算器源代码
- 计算器,源代码
- 源代码计算器
- 源代码计算器
- 源代码计算器
- 源代码计算器
- 简单计算器源代码
- 求助。。!!VC计算器源代码。。。。
- C++ 递归计算器 源代码
- java计算器源代码
- 计算器java源代码
- 计算器 java源代码
- 计算器 java源代码
- 网页计算器制作源代码
- 简单计算器C#源代码
- java计算器源代码
- android虚拟机快速启动
- C#控件命名规范
- JAVA – 虚函数、抽象函数、抽象类、接口
- 预留端口避免占用
- 数据结构之散列表
- 源代码计算器
- 运算符重载
- 黑马程序员---OC基础知识⑥
- 倍增排序
- 说说我的考研之路-初试复习经验
- 【Java二十周年】Delphi转行java的一些小感触
- 单片机使用定时器定时误差问题
- 暴雪维权的背后
- TrueNorth:IBM的百万神经元类人脑芯片