关于最近用过的一些类
学习C#已经有两个多月,在网上查了很多资料,也整理了很多类。大部分来自网络,然后自己修改一下
发个帖整理一下,希望对园友有所帮助
1 热键注册类
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using System.Runtime.InteropServices;
5
using System.Windows.Forms;
6![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
namespace IDCard
8
{
9
class HotKey
10
{
11
//如果函数执行成功,返回值不为0。
12
//如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。
13
[DllImport("user32.dll", SetLastError = true)]
14
public static extern bool RegisterHotKey(
15
IntPtr hWnd, //要定义热键的窗口的句柄
16
int id, //定义热键ID(不能与其它ID重复)
17
KeyModifiers fsModifiers, //标识热键是否在按Alt、Ctrl、Shift、Windows等键时才会生效
18
Keys vk //定义热键的内容
19
);
20
[DllImport("user32.dll", SetLastError = true)]
21
public static extern bool UnregisterHotKey(
22
IntPtr hWnd, //要取消热键的窗口的句柄
23
int id //要取消热键的ID
24
);
25
//定义了辅助键的名称(将数字转变为字符以便于记忆,也可去除此枚举而直接使用数值)
26
[Flags()]
27
public enum KeyModifiers
28
{
29
None = 0,
30
Alt = 1,
31
Ctrl = 2,
32
Shift = 4,
33
WindowsKey = 8
34
}
35
}
36
}
37![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
31
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
32
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
33
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
34
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
35
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
36
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
37
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2 加密解密类
1
using System;
2
using System.Data;
3
using System.Data.OleDb;
4
using System.Collections.Generic;
5
using System.Text;
6
using System.IO;
7
using System.Security.Cryptography;
8
using Microsoft.Win32;
9
using System.Configuration;
10
using System.Windows.Forms;
11![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
12
namespace IDCard
13
{
14
class Decrypt
15
{
16![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
//默认密钥向量
18
private static byte[] Keys = { 0x55, 0x32, 0xF8, 0xEA, 0x93, 0xC3, 0xF9, 0xB2 };
19
/// <summary>
20
/// DES加密字符串
21
/// </summary>
22
/// <param name="encryptString">待加密的字符串</param>
23
/// <param name="encryptKey">加密密钥,要求为8位</param>
24
/// <returns>加密成功返回加密后的字符串,失败返回源串</returns>
25
public static string EncryptDES(string encryptString, string encryptKey)
26
{
27
try
28
{
29
byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey);
30
byte[] rgbIV = Keys;
31
byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString);
32
DESCryptoServiceProvider dCSP = new DESCryptoServiceProvider();
33
MemoryStream mStream = new MemoryStream();
34
CryptoStream cStream = new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
35
cStream.Write(inputByteArray, 0, inputByteArray.Length);
36
cStream.FlushFinalBlock();
37
return Convert.ToBase64String(mStream.ToArray());
38
}
39
catch (Exception e)
40
{
41
MessageBox.Show("Message=" + e.Message);
42
return encryptString;
43
}
44
}
45![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
46
/// <summary>
47
/// DES解密字符串
48
/// </summary>
49
/// <param name="decryptString">待解密的字符串</param>
50
/// <param name="decryptKey">解密密钥,要求为8位,和加密密钥相同</param>
51
/// <returns>解密成功返回解密后的字符串,失败返源串</returns>
52
public static string DecryptDES(string decryptString, string decryptKey)
53
{
54
try
55
{
56
byte[] rgbKey = Encoding.UTF8.GetBytes(decryptKey);
57
byte[] rgbIV = Keys;
58
byte[] inputByteArray = Convert.FromBase64String(decryptString);
59
DESCryptoServiceProvider DCSP = new DESCryptoServiceProvider();
60
MemoryStream mStream = new MemoryStream();
61
CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
62
cStream.Write(inputByteArray, 0, inputByteArray.Length);
63
cStream.FlushFinalBlock();
64
return Encoding.UTF8.GetString(mStream.ToArray());
65
}
66
catch (Exception e)
67
{
68
MessageBox.Show("Message=" + e.Message);
69
return decryptString;
70
}
71
}
72![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
73
public static string Formate(string decryptString, string decryptKey)
74
{
75
string transactSn = string.Empty;
76
if (decryptString != "")
77
{
78
string sn = EncryptDES(EncryptDES(EncryptDES(decryptString, decryptKey), decryptKey),decryptKey);
79
80
sn = Get_MD5_Method1(sn);
81
transactSn = sn.Substring(0, 4) + "-" + sn.Substring(4, 4) +
82
"-" + sn.Substring(8, 4) + "-" + sn.Substring(12, 4);
83
return transactSn;
84
}
85
else
86
return transactSn;
87
}
88![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
89
public static string Get_MD5_Method1(string strSource)
90
{ //new9
91
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
92
//获取密文字节数组
93
byte[] bytResult = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(strSource));
94
//转换成字符串,并取9到25位
95
string strResult = BitConverter.ToString(bytResult, 4, 8);
96
//转换成字符串,32位
97
//string strResult = BitConverter.ToString(bytResult);
98
//BitConverter转换出来的字符串会在每个字符中间产生一个分隔符,需要去除掉
99
strResult = strResult.Replace("-", "");
100
return strResult;
101
}
102
}
103
}
104![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
31
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
32
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
33
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
34
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
35
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
36
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
37
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
38
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
39
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
40
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
41
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
42
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
43
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
44
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
45
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
46
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
47
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
48
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
49
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
50
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
51
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
52
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
53
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
54
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
55
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
56
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
57
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
58
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
59
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
60
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
61
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
62
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
63
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
64
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
65
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
66
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
67
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
68
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
69
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
70
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
71
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
72
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
73
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
74
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
75
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
76
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
77
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
78
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
79
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
80
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
81
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
82
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
83
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
84
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
85
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
86
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
87
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
88
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
89
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
90
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
91
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
92
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
93
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
94
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
95
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
96
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
97
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
98
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
99
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
100
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
101
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
102
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
103
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
104
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3 繁简体转换
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using Microsoft.VisualBasic;
5
namespace IDCard
6
{
7
class FontStyle
8
{
9
/// <summary>
10
/// 繁体转简体
11
/// </summary>
12
/// <param name="str">需转换的繁体文字</param>
13
/// <returns></returns>
14
public static string Traditional2Simplified(string str)
15
{
16
return (Microsoft.VisualBasic.Strings.StrConv(str, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0));
17![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
18
}
19
/// <summary>
20
/// 简体转繁体
21
/// </summary>
22
/// <param name="str">需转换的简体文字</param>
23
/// <returns></returns>
24
public static string Simplified2Traditional(string str)
25
{
26
return (Microsoft.VisualBasic.Strings.StrConv(str as String, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0));
27
}
28![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
29
}
30
}
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
4 读取系统配置文件
1
using System;
2
using System.IO;
3
using System.Runtime.InteropServices;
4
using System.Text;
5
using System.Collections;
6
using System.Collections.Specialized;
7![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
namespace IDCard
9
{
10
/**/
11
/**/
12
/**/
13
/// <summary>
14
/// IniFiles的类
15
/// </summary>
16
public class IniFiles
17
{
18
public string FileName; //INI文件名
19
//声明读写INI文件的API函数
20
[DllImport("kernel32")]
21
private static extern bool WritePrivateProfileString(string section, string key, string val, string filePath);
22
[DllImport("kernel32")]
23
private static extern int GetPrivateProfileString(string section, string key, string def, byte[] retVal, int size, string filePath);
24
//类的构造函数,传递INI文件名
25
public IniFiles(string AFileName)
26
{
27
// 判断文件是否存在
28
FileInfo fileInfo = new FileInfo(AFileName);
29
//Todo:搞清枚举的用法
30
if ((!fileInfo.Exists))
31
{ // ¦ ¦ (FileAttributes.Directory in fileInfo.Attributes))
32
//文件不存在,建立文件
33
System.IO.StreamWriter sw = new System.IO.StreamWriter(AFileName, false, System.Text.Encoding.Default);
34
try
35
{
36
sw.Write("#表格配置档案");
37
sw.Close();
38
}
39
catch
40
{
41
throw (new ApplicationException("Ini文件不存在"));
42
}
43
}
44
//必须是完全路径,不能是相对路径
45
FileName = fileInfo.FullName;
46
}
47
//写INI文件
48
public void WriteString(string Section, string Ident, string Value)
49
{
50
if (!WritePrivateProfileString(Section, Ident, Value, FileName))
51
{
52![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
53
throw (new ApplicationException("写Ini文件出错"));
54
}
55
}
56
//读取INI文件指定
57
public string ReadString(string Section, string Ident, string Default)
58
{
59
Byte[] Buffer = new Byte[65535];
60
int bufLen = GetPrivateProfileString(Section, Ident, Default, Buffer, Buffer.GetUpperBound(0), FileName);
61
//必须设定0(系统默认的代码页)的编码方式,否则无法支持中文
62
string s = Encoding.GetEncoding(0).GetString(Buffer);
63
s = s.Substring(0, bufLen);
64
return s.Trim();
65
}
66![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
67
//读整数
68
public int ReadInteger(string Section, string Ident, int Default)
69
{
70
string intStr = ReadString(Section, Ident, Convert.ToString(Default));
71
try
72
{
73
return Convert.ToInt32(intStr);
74
}
75
catch (Exception ex)
76
{
77
Console.WriteLine(ex.Message);
78
return Default;
79
}
80
}
81![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
82
//写整数
83
public void WriteInteger(string Section, string Ident, int Value)
84
{
85
WriteString(Section, Ident, Value.ToString());
86
}
87![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
88
//读布尔
89
public bool ReadBool(string Section, string Ident, bool Default)
90
{
91
try
92
{
93
return Convert.ToBoolean(ReadString(Section, Ident, Convert.ToString(Default)));
94
}
95
catch (Exception ex)
96
{
97
Console.WriteLine(ex.Message);
98
return Default;
99
}
100
}
101![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
102
//写Bool
103
public void WriteBool(string Section, string Ident, bool Value)
104
{
105
WriteString(Section, Ident, Convert.ToString(Value));
106
}
107![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
108
//从Ini文件中,将指定的Section名称中的所有Ident添加到列表中
109
public void ReadSection(string Section, StringCollection Idents)
110
{
111
Byte[] Buffer = new Byte[16384];
112
//Idents.Clear();
113![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
114
int bufLen = GetPrivateProfileString(Section, null, null, Buffer, Buffer.GetUpperBound(0),
115
FileName);
116
//对Section进行解析
117
GetStringsFromBuffer(Buffer, bufLen, Idents);
118
}
119![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
120
private void GetStringsFromBuffer(Byte[] Buffer, int bufLen, StringCollection Strings)
121
{
122
Strings.Clear();
123
if (bufLen != 0)
124
{
125
int start = 0;
126
for (int i = 0; i < bufLen; i++)
127
{
128
if ((Buffer[i] == 0) && ((i - start) > 0))
129
{
130
String s = Encoding.GetEncoding(0).GetString(Buffer, start, i - start);
131
Strings.Add(s);
132
start = i + 1;
133
}
134
}
135
}
136
}
137
//从Ini文件中,读取所有的Sections的名称
138
public void ReadSections(StringCollection SectionList)
139
{
140
//Note:必须得用Bytes来实现,StringBuilder只能取到第一个Section
141
byte[] Buffer = new byte[65535];
142
int bufLen = 0;
143
bufLen = GetPrivateProfileString(null, null, null, Buffer,
144
Buffer.GetUpperBound(0), FileName);
145
GetStringsFromBuffer(Buffer, bufLen, SectionList);
146
}
147
//读取指定的Section的所有Value到列表中
148
public void ReadSectionValues(string Section, NameValueCollection Values)
149
{
150
StringCollection KeyList = new StringCollection();
151
ReadSection(Section, KeyList);
152
Values.Clear();
153
foreach (string key in KeyList)
154
{
155
Values.Add(key, ReadString(Section, key, ""));
156![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
157
}
158
}
159
//清除某个Section
160
public void EraseSection(string Section)
161
{
162
//
163
if (!WritePrivateProfileString(Section, null, null, FileName))
164
{
165
throw (new ApplicationException("无法清除Ini文件中的Section"));
166
}
167
}
168
//删除某个Section下的键
169
public void DeleteKey(string Section, string Ident)
170
{
171
WritePrivateProfileString(Section, Ident, null, FileName);
172
}
173
//Note:对于Win9X,来说需要实现UpdateFile方法将缓冲中的数据写入文件
174
//在Win NT, 2000和XP上,都是直接写文件,没有缓冲,所以,无须实现UpdateFile
175
//执行完对Ini文件的修改之后,应该调用本方法更新缓冲区。
176
public void UpdateFile()
177
{
178
WritePrivateProfileString(null, null, null, FileName);
179
}
180![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
181
//检查某个Section下的某个键值是否存在
182
public bool ValueExists(string Section, string Ident)
183
{
184
//
185
StringCollection Idents = new StringCollection();
186
ReadSection(Section, Idents);
187
return Idents.IndexOf(Ident) > -1;
188
}
189![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
190
//确保资源的释放
191
~IniFiles()
192
{
193
UpdateFile();
194
}
195
}
196
}
197![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
198![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
31
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
32
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
33
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
34
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
35
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
36
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
37
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
38
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
39
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
40
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
41
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
42
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
43
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
44
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
45
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
46
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
47
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
48
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
49
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
50
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
51
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
52
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
53
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
54
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
55
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
56
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
57
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
58
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
59
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
60
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
61
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
62
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
63
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
64
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
65
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
66
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
67
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
68
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
69
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
70
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
71
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
72
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
73
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
74
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
75
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
76
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
77
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
78
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
79
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
80
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
81
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
82
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
83
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
84
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
85
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
86
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
87
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
88
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
89
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
90
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
91
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
92
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
93
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
94
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
95
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
96
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
97
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
98
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
99
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
100
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
101
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
102
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
103
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
104
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
105
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
106
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
107
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
108
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
109
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
110
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
111
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
112
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
113
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
114
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
115
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
116
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
117
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
118
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
119
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
120
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
121
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
122
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
123
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
124
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
125
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
126
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
127
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
128
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
129
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
130
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
131
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
132
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
133
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
134
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
135
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
136
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
137
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
138
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
139
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
140
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
141
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
142
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
143
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
144
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
145
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
146
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
147
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
148
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
149
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
150
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
151
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
152
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
153
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
154
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
155
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
156
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
157
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
158
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
159
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
160
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
161
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
162
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
163
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
164
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
165
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
166
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
167
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
168
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
169
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
170
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
171
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
172
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
173
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
174
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
175
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
176
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
177
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
178
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
179
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
180
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
181
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
182
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
183
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
184
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
185
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
186
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
187
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
188
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
189
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
190
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
191
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
192
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
193
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
194
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
195
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
196
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
197
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
198
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)