2012年4月18日
摘要:
/// <summary> /// 移动文件 /// </summary> /// <param name="source">源目录</param> /// <param name="target">目标目录</param> private bool MoveFolderTo(string srcPath, string tgtPath) { try { //检查目标目录是否是以分割符结束,如果不是这添加 if (tgtPath[tgtPath.Length - 1] != Syst
阅读全文
posted @ 2012-04-18 08:35
武胜-阿伟
阅读(433)
推荐(0)
摘要:
//获取类型信息//如果调用其他的DLL//System.Reflection.Assembly asmb = System.Reflection.Assembly.LoadFrom("DLL名");// Type t = asmb.GetType("类名");//如果是不调用其他DLLSystem.Type t = System.Type.GetType("类名"); try { object dObj = Activator.CreateInstance(t); //获取方法的信息 System.Reflection.Metho.
阅读全文
posted @ 2012-04-18 08:33
武胜-阿伟
阅读(3228)
推荐(0)
2012年4月17日
摘要:
///<summary>///使用了params关键字///</summary>///<paramname="values">int[]</param>///<returns>int[]的和</returns>staticInt32Add(paramsInt32[]values){Int32sum=0;for(intx=0;x<values.Length;x++)sum+=values[x];returnsum;}
阅读全文
posted @ 2012-04-17 09:49
武胜-阿伟
阅读(129)
推荐(0)
2012年4月15日
摘要:
表:issue 字段:id:1time:2012-04-01 08:15:00count:12。。。。。按小时统计count总数,结果如下1 2012-04-01 8:00~9:00 1342 2012-04-01 9:00~10:00 134---------------------------select DATE_FORMAT(time,'%Y-%m-%d %H:00'),sum(count)from issuegroup by DATE_FORMAT(time,'%Y-%m-%d %H:00')
阅读全文
posted @ 2012-04-15 08:12
武胜-阿伟
阅读(225)
推荐(0)
摘要:
新项目中使用了WCF 实现客户端与服务器的通讯。c/s架构,客户端采用winfrom实现。项目试运行期间,很多用户都抱怨系统总是无法正常登录。查看日志发现如下异常信息:System.ServiceModel.Security.MessageSecurityException: 从另一方收到未进行安全处理或安全处理不正确的错误。有关错误代码和详细信息,请参阅内部 FaultException。 ---> System.ServiceModel.FaultException: 消息中至少有一个安全令牌无法验证。 WCF通讯采用了UserName安全认证方式,用Google大神搜索一番,上述异
阅读全文
posted @ 2012-04-15 08:09
武胜-阿伟
阅读(1109)
推荐(0)
摘要:
使用WCF的默认DataContractSerializer手动去序列化成byte[],然后接收后再手动去反序列化,能解决这个问题。也就是说单纯的byte[]能过去,直接将下面代码中的list以List<May>返回去就是出现LZ遇到的问题。也就是说序列化与反序列化这一大块数据都没问题。主要问题还是出现在WCF组装消息上了。设置一下 ReaderQuotas 这个属性,这是设置消息复杂性的。感觉这种症状很像被DOS干掉的感觉,于是想到ReaderQuotas。下面是我尝试的例子。C# codepublicbyte[] GetMays() { DataContractSerializ
阅读全文
posted @ 2012-04-15 08:04
武胜-阿伟
阅读(2186)
推荐(0)
摘要:
行转成例,用的是MYSQL,不知道有没办法做到下面的转换?工序 料名1 A11 A22 A12 A32 A43 B13 B23 B33 B44 A14 B34 B4转成:工序 料名1 料名2 料名3 料名4 料名51 A1 A2 2 A1 A3 A4 3 B1 B2 B3 B4 4 A1 B3 B4select 工序,group_concat(料名 SEPARATOR ' ')from tbgroup by 工序
阅读全文
posted @ 2012-04-15 07:47
武胜-阿伟
阅读(358)
推荐(0)
2012年4月9日
摘要:
public class MyClass { PerformanceCounter counter = null; public float CpuUsage { get { if (counter== null) { counter = new PerformanceCounter ("Processor", "% Processor Time", "_Total"); } return (counter.NextValue ()); } }}
阅读全文
posted @ 2012-04-09 16:47
武胜-阿伟
阅读(196)
推荐(0)
2012年4月5日
posted @ 2012-04-05 15:07
武胜-阿伟
阅读(1431)
推荐(0)
2012年3月17日
摘要:
9 down voteJust add this<NetFx40_LegacySecurityPolicy enabled="true"/> into your VS2010 DevEnv configuration file, you'll find it in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.configThere is a <runtime> section, just copy it at the first plac
阅读全文
posted @ 2012-03-17 19:23
武胜-阿伟
阅读(7763)
推荐(0)