
C#
文章平均质量分 59
Chobitssp
这个作者很懒,什么都没留下…
展开
-
C# Excel
Imports System.Xml.XslImports System.Web.SecurityImports System.ConfigurationImports System.Web.UI.WebControlsImports System.Web.UI.HtmlControlsImports System.Web.UI.WebControls.WebPartsNamesp转载 2012-08-03 09:31:08 · 728 阅读 · 0 评论 -
Windows服务 日志简单实现
Windows服务 日志简单实现using System;using System.Diagnostics;using System.IO;using System.Reflection;namespace Service.Util{ public class FileLogger { const string LOG_FILE_NAME =原创 2014-04-25 10:22:03 · 3092 阅读 · 0 评论 -
c# stream
1 /// /// 从流获取指定长度的字节数组 /// public static IEnumerable GetBytes(this Stream stream, long length, int size = 1024) { byte[] buffer = new byte[s原创 2014-05-04 08:55:17 · 932 阅读 · 0 评论 -
NAudio 播放进度问题
问题 : IWavePlayer接口给出的PlaybackStopped事件不能在文件播放完毕后触发http://stackoverflow.com/questions/11272872/naudio-how-to-tell-playback-is-completed解决方法:WaveChannel32 stream;double d = (double)stream.P原创 2013-12-03 11:33:31 · 2531 阅读 · 1 评论 -
C# SevenZip简单操作
using SevenZip;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;namespace Test{ public static class ZipHelper { static bool Is6原创 2013-12-03 11:26:37 · 4469 阅读 · 0 评论 -
Sql反射增删查改
using System;using System.Collections.Generic;using System.Text;using System.Reflection;using System.Data;using System.Data.OleDb;namespace DAL{ public class SqlBuilder where T : class原创 2013-05-11 16:02:00 · 1143 阅读 · 0 评论 -
.NET CsvWriter
Imports System.TextImports System.IO''' ''' 快速写入数据到CSV文件''' Public Class CsvWriter#Region "Constants" ''' ''' Defines the default delimiter character separating each field. '''原创 2012-11-01 15:53:22 · 1072 阅读 · 0 评论 -
C# 与 Vb.net 互转
CSharp2VB:C#代码转换到Vb.net的程序VB2Csharp:VB转换到C#的程序(同时还支持Delphi、Vb6到C#的转换)下面两个都可以支持双向转换http://www.codechanger.com/在线版地址:http://www.developerfusion.com/tools/convert/csharp-to-vb/以下也是几转载 2012-09-17 10:03:38 · 2519 阅读 · 0 评论 -
SortedList、SortedSet、HashSet、Hashtable、Dictionary、SortedDictionary 排序/可重复排序/过滤重复排序等简单对比
//泛型的键值集合/有序/Hash算法/占内存较大/不排序,不受装填因子的限制,对读写操作效率较高 Dictionary dc = new Dictionary(); dc.Add(1, "111111"); dc.Add(2, "222222"); dc.Add(3, "333333");转载 2012-10-30 12:34:11 · 812 阅读 · 0 评论 -
C#中通过读取配置文件动态创建泛型对象
众所周知,在c#中,我们在获知的某一类型后,可以运用Activator.CreateInstance来动态的创建对象的实例。获取类型的话,可以使用typeof或者GetType来实现。而笔者最近遇到了一个需要通过读取配置文件来动态创建泛型类型的案例,让我们一起来看一下。1. 背景我们考虑一下这样的一个场景,我们需要开发了一个用于排序的通用的可扩展的库。利用该库,用户可以自定义排序规转载 2012-09-17 16:08:03 · 2342 阅读 · 0 评论 -
C#和VB.net语法对比
C#和VB.net的语法相差还是比较大的. 可能你会C#,可能你会VB.将它们俩放在一起对比一下你就会很快读懂,并掌握另一门语言.相信下面这张图会对你帮助很大.CommentsVB.NET ‘Single line only Rem Single line only C#// Sing转载 2012-09-05 15:03:37 · 2573 阅读 · 0 评论 -
Linq、 集合、数组、Lambda、QuerySyntax
目录1 LINQ查询结果集 1 2 System.Array 数组 12.1 基于System.Array定义数组 12.2 基于类型定义数组 12.3 数组元素的清空 12.4 System.Array类静态成员 12.5 不用循环填充数组 1转载 2012-09-29 17:54:43 · 2791 阅读 · 0 评论 -
C#泛型列表List基本用法总结
mespace SampleListT{ class Program { static void Main(string[] args) { //using System.Collections.Generic; 命名空间中的List //using System.Collections; 命名空间中的ArrayList转载 2012-09-28 17:13:53 · 966 阅读 · 0 评论 -
C# ToString()用法汇总
C货币2.5.ToString("C")¥2.50D十进制数25.ToString("D5")00025E科学型25000.ToString("E")2.500000E+005F转载 2012-09-07 17:57:57 · 983 阅读 · 0 评论 -
IEnumerable(Of T)、IEnumerable、ICollection(Of T)、IList(Of T)、ObservableCollectin(Of T)和Collection(Of
1.如果你返回的集合是只用于遍历,不可修改的,则返回IEnumerable2.如果返回的集合需要修改,如添加和删除元素,用ICollection3.如果返回的集合需要支持排序,索引等,用IList4.如果返回的集合要支持索引,但不能添加,删除元素,用ReadOnlyCollection ICollection主要针对静态集合;IList主要针对动态集合IEnumerable转载 2012-09-01 11:28:22 · 816 阅读 · 0 评论 -
C# Astar算法
http://firechun.blog.163.com/blog/static/31804522200961132413534/转载 2012-07-30 16:03:56 · 1105 阅读 · 0 评论 -
京东
public string OpenReadWithHttps(string URL, string strPostdata) { Encoding encoding = Encoding.Default; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);转载 2012-08-10 16:49:19 · 875 阅读 · 0 评论 -
Dictionary序列化
VB.NETImports SystemImports System.Collections.GenericImports System.Runtime.SerializationImports System.XmlImports System.Xml.SchemaImports System.Xml.Serialization''' ''' 支持XML序列化的字典转载 2012-08-10 12:35:35 · 1120 阅读 · 0 评论 -
百度 云推送 C# 服务端 SDK
PM> Install-Package BaiduPushhttps://baidupush.svn.codeplex.com/svn/src/PushTestForm/PushHelper.cs原创 2014-07-01 09:52:47 · 1612 阅读 · 0 评论