![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
文章平均质量分 58
标哥-iOS攻城狮
现从事iOS开发,业余研究HTML5+CSS3+PHP+Mysql,cocos2dx中...
展开
-
C#第二章1
using System;namespace CSharpPractice{ struct Rectangle { public int xLeftTop;//左上角横坐标 public int yLeftTop;//左上角纵坐标 public int width; //矩形的宽 public int hei原创 2012-12-01 07:56:52 · 516 阅读 · 0 评论 -
C#输入年份,判断闰年平年
private void btnJudge_Click(object sender, EventArgs e) { uint uiYear; if (uint.TryParse(txtYear.Text, out uiYear)) { if (uiYear % 4 == 0 &&原创 2012-12-05 23:51:52 · 6110 阅读 · 0 评论 -
C#typeof
private Type GetInputType() { string strText = txtType.Text; switch (strText) { case "Int32": case "int" : case "System.Int32":原创 2012-12-06 07:13:55 · 1370 阅读 · 0 评论 -
C#汉字反序输出
private void txtHanZhi_TextChanged(object sender, EventArgs e) { char[] chr = txtHanZhi.Text.ToCharArray(); //转换成字符数组 Array.Reverse(chr, 0, txtHanZhi.Text.Length)原创 2012-12-06 11:09:10 · 650 阅读 · 0 评论 -
C#判断汉字的个数
private void btnNum_Click(object sender, EventArgs e) { if (txtWords.Text.Length == 0) //判断是否为空 { MessageBox.Show("请输入汉字:");原创 2012-12-06 11:55:52 · 1411 阅读 · 0 评论 -
Sqlserver类
using System;using System.Data;using System.Data.SqlClient;namespace SqlConn{ /// /// Sqlserver类:增、删、查结果集、查单个字段、改功能 /// class Sqlserver { #region 成员变量声明 //连接原创 2012-11-23 14:33:37 · 634 阅读 · 0 评论 -
ADO.NET入门
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace Northwind{ class Program { static void原创 2012-11-24 06:55:10 · 420 阅读 · 0 评论 -
C#正则表达式
"^\d+$" //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$" //正整数 "^((-\d+)|(0+))$" //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$" //负整数 "^-?\d+$" //整数 "^\d+(\.\d+)?$" //非负浮点数(正浮点数 + 0) "^(([0-9]+\.[0-9]*[1-9][0-9]*)翻译 2012-12-15 09:35:40 · 403 阅读 · 0 评论 -
C#XML文件读写操作
/// /// 描述: /// 加载播放列表 /// private void LoadPlaylist() { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(_strXmlFilePath);原创 2013-03-31 09:31:37 · 714 阅读 · 0 评论 -
C#生产者与消费者问题
/* * Created by SharpDevelop. * User: huangyibiao * Date: 2013/8/27 * Time: 11:12 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */using System;using Syste原创 2013-08-27 12:29:31 · 994 阅读 · 0 评论 -
C#生产者与消费者问题(二)
/* * Created by SharpDevelop. * User: huangyibiao * Date: 2013/8/27 * Time: 11:12 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */using System;using Syste原创 2013-08-27 12:53:57 · 809 阅读 · 0 评论 -
分析文件路径、文件名、拓展名
private void btnFile_Click(object sender, EventArgs e) { if (odlgFile.ShowDialog() == DialogResult.OK) { // //获取文件全路径 //原创 2012-12-06 11:36:20 · 774 阅读 · 0 评论 -
C#第一课
using System;namespace HelloACCP{ /// /// 此代码为第1章理论课作业简答题第3题 /// class MainClass { static void Main(string[] args) { string strName1 = "张三"; /原创 2012-11-20 21:21:21 · 409 阅读 · 0 评论 -
C#输入的类型转换
using System;using System.Collections.Generic;using System.Text;namespace ConsoleIO{ class Program { static void Main(string[] args) { Console.Write("Please e原创 2012-11-18 22:15:27 · 552 阅读 · 0 评论 -
c#中override virtual static abstract sealed 的作用
c#中override virtual static abstract sealed 的作用 说明1: 表示静态的关键字说明此对象在应用中只存在一份 说明2: C# 是面向对象的程序设计语言,每一个函数都属于一个类。 当一个方法被声明为Static时,这个方法是一个静态方法,编译器会在编译时保留这个方法的实现。也就是说,这个方法属于类,但是不属于任何成员,不管这个类转载 2012-11-18 07:37:06 · 1270 阅读 · 1 评论 -
C#冒泡排序
using System;namespace huangyibiao{ class Program { //交换 public static void Swap(ref int iLeftParam, ref int iRightParam) { int iTemp = iLeftParam;原创 2012-11-19 18:22:34 · 385 阅读 · 0 评论 -
C#练习
using System;using System.Collections;namespace huangyibiao{ class Program { public static void PrintValues(IEnumerable ie, char chrSeperator) { foreach (Object原创 2012-11-19 17:46:35 · 531 阅读 · 0 评论 -
C#统计输入的字符类型数量
using System;namespace huangyibiao{ class Program { static void Main(string[] args) { int iCountLetters = 0; //number of letters int iCountDigits =原创 2012-11-19 11:38:48 · 908 阅读 · 0 评论 -
C#文件目录操作
using System;using System.IO;namespace huangyibiao{ class Program { public static void DisplayDirectorys(DirectoryInfo dirInfo) { Console.WriteLine(dirInfo.Full原创 2012-11-19 22:06:01 · 458 阅读 · 0 评论 -
C#线程
using System;using System.Threading;namespace huangyibiao{ public class BookShop { //共享资源 public int _iBookNumber = 1; public void Sale() { int原创 2012-11-19 22:25:42 · 379 阅读 · 0 评论 -
C#基础部分
using System;class Hello{ public static int Main() { Console.WriteLine("{0},你好,本月的业绩是{1:c}", "Miles", 50000000); Console.WriteLine("目前一共有员工{0}人,平均成本为{1:N2}元", 150,原创 2012-12-03 16:10:23 · 506 阅读 · 0 评论 -
C#复数类
using System;namespace ConsoleIO{ /// /// Complex复数类 两个数据成员:实部:_real 虚部:_imag /// /// public class Complex { private int _imag; private int _real; //默认构造函数 public Complex()原创 2012-11-20 19:08:49 · 2565 阅读 · 0 评论 -
C#如何判断键入回车键
private void txtPassword_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { pbxLogin_Click(sender, e as EventArgs); }原创 2013-09-08 15:04:44 · 12667 阅读 · 0 评论