c#常见异常47个
1 ArgumentException 在向方法提供的其中一个参数无效时引发的异常
2 AppDomainUnloadedException 在尝试访问已卸载的应用程序域时引发的异常
3 ArithmeticException 因算术运算、类型转换或转换操作中的错误而引发的异常
4 ArrayTypeMismatchException 当试图在数组中存储类型不正确的元素时引发的异常
5 BadImageFormatException 当 DLL 或可执行程序的文件图像无效时引发的异常
6 CannotUnloadAppDomainException 卸载应用程序域的尝试失败时引发的异常
7 CodeDomSerializerException 当行号信息可用于序列化错误时引发的异常
8 LicenseException 表示当组件不能被授予许可证时引发的异常
9 WarningException 指定按警告(而不是错误)处理的异常
10 ConfigurationException 配置设置中发生错误时引发的异常
11 InstallException 在安装的提交、回滚或卸载阶段发生错误时引发的异常
12 ContextMarshalException 在尝试将对象封送过上下文边界失败时引发的异常
13 DataException 表示使用 ADO.NET 组件发生错误时引发的异常
14 DBConcurrencyException 在更新操作过程中受影响的行数等于零时,由 DataAdapter 所引发的异常
15 SqlException 当 SQL Server 返回警告或错误时引发的异常。无法继承此类
16 InvalidPrinterException 表示当试图用无效的打印机设置来访问打印机时所引发的异常
17 RegistrationException 检测到注册错误时引发的异常
18 FormatException 当参数格式不符合调用的方法的参数规范时引发的异常
19 IndexOutOfRangeException 试图访问索引超出数组界限的数组元素时引发的异常
20 InvalidCastException 因无效类型转换或显式转换引发的异常
21 InvalidOperationException 当方法调用对于对象的当前状态无效时引发的异常
22 InternalBufferOverflowException 内部缓冲区溢出时引发的异常
23 IOException 发生 I/O 错误时引发的异常
相关文档:
send :
string path = "E:\\c#\\convey_file\\convey_file\\Form1.cs"; //要传输的文件
TcpClient client = new TcpClient();
client.Connect(IPAddress.Parse("192.168.0.52"),9999);
FileStream file = new FileStream(path,FileMode.Open,FileAccess.Read); // ......
C#Windows服务程序的快速开发向你介绍了在很多应用中需要做windows服务来操作数据库等操作,希望对你了解C#Windows服务程序的开发有所帮助。
C#Windows服务程序的快速开发:在很多应用中需要做windows服务来操作数据库等操作,比如
(1)一些非常慢的数据库操作,不想一次性去做,想慢慢的通过服务定时去做,比如定时为 ......
public struct RECT
{
public int left;
public int Top;
public int Right;
public int Bottom;
}
public static bool CenterMouseOn(int hwnd)
{
......
public struct POINTAPI
{
public int x;
public int y;
}
public static void GetWindowfromPoint(ref int hwnd,ref StringBuilder winText,ref StringBuilder clsName,ref StringBuilder pText)
{
int parentHandle=0;
int maxLen=128;
POINTAPI pnt = new ......
一、插图的类(含2方法)
1using System;
2using System.Collections.Generic;
3using System.Text;
4//using Excel = Microsoft.Office.Interop.Excel;
5using Excel;
6using System.Windows.Forms;
7
8
9namespace ExcelReport
10{
11 class InsertPicToExcel
12 {
13 / ......