在使用 CryptoAPITransform进行加密时异常要调用Reset() 通过.net源码能看到Reset()里有 public void Reset() { _depadBuffer = null; // just ensure we've called CryptEncrypt with the true flag byte[] temp = null; Utils._EncryptData(_safeKeyHandle, EmptyArray<Byte>.Value, 0, 0,…
在 Visual Studio 中进行 WPF, UWP, Silverlight 开发时,经常会遇到 XAML 设计器由于遭遇异常而无法正常显示设计器视图的情况.很多时候由于最终生成的项目在运行时并不会出现同样的异常,我们往往会忽略设计时异常,仅仅通过关闭设计器在设计时执行代码的功能来规避设计器异常的问题. 规避设计时异常 一般有两种做法: 1.关闭设计器执行代码 在 Visual Studio 2015 中,XAML 设计器左下角的这个按钮可以随时开启或关闭设计器执行代码.如果在 UI 相关…
XP机器上WCF采用X509证书加密时IIS读取证书的授权 XP下的授权命令为:winhttpcertcfg -g -c LOCAL_MACHINE\My -s 证书名称 -a "ASPNET" 如为2003的机器,授权命令为:winhttpcertcfg -g -c LOCAL_MACHINE\My -s 证书名称 -a "NETWORK SERVICE" winhttpcertcfg.exe程序需要在微软网站上下载.…
现象: 无论建立的是Win32 Console的解决方案,还是MFC的解决方案,重新打开Visual Studio 2010之后,编译时总是提示“调用的目标发生了异常” 解决: 1. 关闭Visual Studio 2. 找到.sln所在目录,用文本编辑器打开sln文件,发现有如下的定义 GlobalSection(PowerDesigner) = preSolution HasSWS = 1 EndGlobalSection     剁了这三行 3.  删除.suo文件 4.  重新打开Vis…
[转载自]:http://blog.csdn.net/qq7342272/article/details/7940741 java运行时异常是可能在java虚拟机正常工作时抛出的异常. java提供了两种异常机制.一种是运行时异常(RuntimeExepction),一种是检查式异常(checked execption). 检查式异常:我们经常遇到的IO异常及sql异常就属于检查式异常.对于这种异常,java编译器要求我们必须对出现的这些异常进行catch 所以 面对这种异常不管我们是否愿意,只…
使用AES加密时,当密钥大于128时,代码会抛出java.security.InvalidKeyException: Illegal key size or default parameters Illegal key size or default parameters是指密钥长度是受限制的,java运行时环境读到的是受限的policy文件.文件位于${java_home}/jre/lib/security 这种限制是因为美国对软件出口的控制. 解决办法: 去掉这种限制需要下载Java Cry…
NullPointerException:是运行时异常(RuntimeException),也叫非检查异常 所以我们抛出该类异常实例时,方法声明处无需添加throws来列举该类异常的抛出,编译器在编译该类时 也忽略对该类异常抛出的检查(编译时不看他是不是在throws中被列举). 检查异常:编译时检查(需要throws)…
/** * Return whether the given throwable is a checked exception: * that is, neither a RuntimeException nor an Error. * @param ex the throwable to check * @return whether the throwable is a checked exception * @see java.lang.Exception * @see java.lang…
原文:AES加密时抛出java.security.InvalidKeyException: Illegal key size or def 使用AES加密时,当密钥大于128时,代码会抛出 java.security.InvalidKeyException: Illegal key size or default parameters Illegal key size or default parameters是指密钥长度是受限制的,java运行时环境读到的是受限的policy文件.文件位于${…
1,将运行时异常捕获并存到手机SD卡上 可以直接使用logcat 命令Runtime.getRuntime().exec("logcat -f "+ file.getAbsolutePath());指定文件路径就可以了 package com.hai.logcat; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileNotFound…