广告位联系
返回顶部
分享到

C#实现图片轮播功能的代码

C#教程 来源:互联网 作者:秩名 发布时间:2022-12-19 22:21:46 人浏览
摘要

实践过程 效果 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

实践过程

效果

代码

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

public partial class Form1 : Form

{

    public Form1()

    {

        InitializeComponent();

    }

 

    public bool Pflag;

    int flag = 0;

    FileSystemInfo[] fsinfo;

    ArrayList al = new ArrayList();

    int MM = 0;

 

    private void splitContainer2_Panel2_Paint(object sender, PaintEventArgs e)

    {

    }

 

    private void Form1_Load(object sender, EventArgs e)

    {

        cbbShowType.SelectedIndex = 0;

    }

 

    private void button1_Click(object sender, EventArgs e)

    {

        if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)

        {

            al.Clear();

            listBox1.Items.Clear();

            txtPicPath.Text = folderBrowserDialog1.SelectedPath;

            DirectoryInfo di = new DirectoryInfo(txtPicPath.Text);

            fsinfo = di.GetFileSystemInfos();

            for (int i = 0; i < fsinfo.Length; i++)

            {

                string filename = fsinfo[i].ToString();

                string filetype = filename.Substring(filename.LastIndexOf(".") + 1, filename.Length - filename.LastIndexOf(".") - 1);

                filetype = filetype.ToLower();

                if (filetype == "jpeg" || filetype == "jpg" || filetype == "png" || filetype == "gif" || filetype == "bmp")

                {

                    listBox1.Items.Add(fsinfo[i].ToString());

                    al.Add(fsinfo[i].ToString());

                    flag++;

                }

            }

 

            listBox1.SetSelected(0, true);

            listBox1.Focus();

            tssltotel.Text = "共有" + flag + "张图片";

            Pflag = true;

        }

    }

 

    private void listBox1_SelectedIndexChanged(object sender, EventArgs e)

    {

        string picpath = txtPicPath.Text + "\\" + listBox1.SelectedItem.ToString();

        tsslPath.Text = "|当前第" + Convert.ToString(listBox1.SelectedIndex + 1) + "张图片|图片位置:" + picpath;

        pictureBox1.Image = Image.FromFile(picpath);

        MM = listBox1.SelectedIndex;

    }

 

    private void button3_Click(object sender, EventArgs e)

    {

        listBox1.Items.Clear();

        txtPicPath.Text = "";

        tssltotel.Text = "";

        tsslPath.Text = "";

        pictureBox1.Image = null;

        Pflag = false;

        timer1.Stop();

        button5.Enabled = true;

    }

 

    private void button5_Click(object sender, EventArgs e)

    {

        if (Pflag)

        {

            if (txtTime.Text != "")

            {

                if (cbbShowType.SelectedIndex == 1)

                {

                    timer1.Interval = int.Parse(txtTime.Text.Trim());

                    timer1.Start();

                    button5.Enabled = false;

                }

                else

                {

                    Form2 frm2 = new Form2();

                    frm2.fsi = al;

                    frm2.picPath = txtPicPath.Text.Trim();

                    frm2.mytimer = int.Parse(txtTime.Text.Trim());

                    frm2.ShowDialog();

                }

            }

        }

    }

 

    private void timer1_Tick(object sender, EventArgs e)

    {

        if (MM < listBox1.Items.Count)

        {

            if (txtPicPath.Text.Trim().Length == 3)

            {

                pictureBox1.Image = Image.FromFile(txtPicPath.Text.Trim() + listBox1.Items[MM].ToString());

                listBox1.SetSelected(MM, true);

            }

            else

            {

                pictureBox1.Image = Image.FromFile(txtPicPath.Text.Trim() + "\\" + listBox1.Items[MM].ToString());

                listBox1.SetSelected(MM, true);

            }

        }

 

        MM++;

    }

 

    private void txtTime_KeyPress(object sender, KeyPressEventArgs e)

    {

        if (!(e.KeyChar <= '9' && e.KeyChar >= '0') && e.KeyChar != '\r' && e.KeyChar != '\b')

        {

            e.Handled = true;

        }

    }

 

    private void txtTime_KeyDown(object sender, KeyEventArgs e)

    {

        if (txtTime.Text != "")

        {

            if (txtTime.Text.Trim().Substring(0, 1) == "0")

            {

                txtTime.Text = txtTime.Text.Substring(1, txtTime.Text.Length - 1);

            }

        }

    }

 

    private void button6_Click(object sender, EventArgs e)

    {

        timer1.Stop();

        button5.Enabled = true;

    }

}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

public partial class Form2 : Form

{

    public Form2()

    {

        InitializeComponent();

    }

    public ArrayList fsi=new ArrayList();

    public int mytimer;

    public string picPath;

    private void pictureBox1_Click(object sender, EventArgs e)

    {

        timer1.Stop();

        this.Close();

    }

 

    private void pictureBox2_Click(object sender, EventArgs e)

    {

 

    }

 

    private void Form2_Load(object sender, EventArgs e)

    {

        timer1.Interval = mytimer;

        timer1.Start();

    }

 

    int MM = 0;

    private void timer1_Tick(object sender, EventArgs e)

    {

        if (MM <fsi.Count)

        {

            if (picPath.Length == 3)

            {

                pictureBox2.Image = Image.FromFile(picPath +fsi[MM].ToString());

            }

            else

            {

                pictureBox2.Image = Image.FromFile(picPath + "\\" + fsi[MM].ToString());

            }

        }

        MM++;

    }

}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

partial class Form1

   {

       /// <summary>

       /// 必需的设计器变量。

       /// </summary>

       private System.ComponentModel.IContainer components = null;

 

       /// <summary>

       /// 清理所有正在使用的资源。

       /// </summary>

       /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>

       protected override void Dispose(bool disposing)

       {

           if (disposing && (components != null))

           {

               components.Dispose();

           }

           base.Dispose(disposing);

       }

 

       #region Windows 窗体设计器生成的代码

 

       /// <summary>

       /// 设计器支持所需的方法 - 不要

       /// 使用代码编辑器修改此方法的内容。

       /// </summary>

       private void InitializeComponent()

       {

           this.components = new System.ComponentModel.Container();

           this.statusStrip1 = new System.Windows.Forms.StatusStrip();

           this.tssltotel = new System.Windows.Forms.ToolStripStatusLabel();

           this.tsslPath = new System.Windows.Forms.ToolStripStatusLabel();

           this.splitContainer1 = new System.Windows.Forms.SplitContainer();

           this.listBox1 = new System.Windows.Forms.ListBox();

           this.button6 = new System.Windows.Forms.Button();

           this.button5 = new System.Windows.Forms.Button();

           this.button3 = new System.Windows.Forms.Button();

           this.cbbShowType = new System.Windows.Forms.ComboBox();

           this.txtTime = new System.Windows.Forms.TextBox();

           this.label2 = new System.Windows.Forms.Label();

           this.button1 = new System.Windows.Forms.Button();

           this.txtPicPath = new System.Windows.Forms.TextBox();

           this.label1 = new System.Windows.Forms.Label();

           this.pictureBox1 = new System.Windows.Forms.PictureBox();

           this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();

           this.timer1 = new System.Windows.Forms.Timer(this.components);

           this.statusStrip1.SuspendLayout();

           this.splitContainer1.Panel1.SuspendLayout();

           this.splitContainer1.Panel2.SuspendLayout();

           this.splitContainer1.SuspendLayout();

           ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();

           this.SuspendLayout();

           //

           // statusStrip1

           //

           this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {

           this.tssltotel,

           this.tsslPath});

           this.statusStrip1.Location = new System.Drawing.Point(0, 398);

           this.statusStrip1.Name = "statusStrip1";

           this.statusStrip1.Size = new System.Drawing.Size(616, 22);

           this.statusStrip1.TabIndex = 0;

           this.statusStrip1.Text = "statusStrip1";

           //

           // tssltotel

           //

           this.tssltotel.BackColor = System.Drawing.Color.Transparent;

           this.tssltotel.Name = "tssltotel";

           this.tssltotel.Size = new System.Drawing.Size(0, 17);

           //

           // tsslPath

           //

           this.tsslPath.BackColor = System.Drawing.Color.Transparent;

           this.tsslPath.Name = "tsslPath";

           this.tsslPath.Size = new System.Drawing.Size(0, 17);

           //

           // splitContainer1

           //

           this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;

           this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;

           this.splitContainer1.Location = new System.Drawing.Point(0, 0);

           this.splitContainer1.Name = "splitContainer1";

           //

           // splitContainer1.Panel1

           //

           this.splitContainer1.Panel1.Controls.Add(this.listBox1);

           this.splitContainer1.Panel1.Controls.Add(this.button6);

           this.splitContainer1.Panel1.Controls.Add(this.button5);

           this.splitContainer1.Panel1.Controls.Add(this.button3);

           this.splitContainer1.Panel1.Controls.Add(this.cbbShowType);

           this.splitContainer1.Panel1.Controls.Add(this.txtTime);

           this.splitContainer1.Panel1.Controls.Add(this.label2);

           this.splitContainer1.Panel1.Controls.Add(this.button1);

           this.splitContainer1.Panel1.Controls.Add(this.txtPicPath);

           this.splitContainer1.Panel1.Controls.Add(this.label1);

           //

           // splitContainer1.Panel2

           //

           this.splitContainer1.Panel2.Controls.Add(this.pictureBox1);

           this.splitContainer1.Size = new System.Drawing.Size(616, 398);

           this.splitContainer1.SplitterDistance = 205;

           this.splitContainer1.SplitterWidth = 1;

           this.splitContainer1.TabIndex = 1;

           //

           // listBox1

           //

           this.listBox1.FormattingEnabled = true;

           this.listBox1.ItemHeight = 12;

           this.listBox1.Location = new System.Drawing.Point(5, 148);

           this.listBox1.Name = "listBox1";

           this.listBox1.Size = new System.Drawing.Size(195, 244);

           this.listBox1.TabIndex = 0;

           this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);

           //

           // button6

           //

           this.button6.Location = new System.Drawing.Point(70, 119);

           this.button6.Name = "button6";

           this.button6.Size = new System.Drawing.Size(63, 23);

           this.button6.TabIndex = 9;

           this.button6.Text = "停止播放";

           this.button6.UseVisualStyleBackColor = true;

           this.button6.Click += new System.EventHandler(this.button6_Click);

           //

           // button5

           //

           this.button5.Location = new System.Drawing.Point(5, 119);

           this.button5.Name = "button5";

           this.button5.Size = new System.Drawing.Size(63, 23);

           this.button5.TabIndex = 8;

           this.button5.Text = "开始播放";

           this.button5.UseVisualStyleBackColor = true;

           this.button5.Click += new System.EventHandler(this.button5_Click);

           //

           // button3

           //

           this.button3.Location = new System.Drawing.Point(135, 119);

           this.button3.Name = "button3";

           this.button3.Size = new System.Drawing.Size(63, 23);

           this.button3.TabIndex = 6;

           this.button3.Text = "清除数据";

           this.button3.UseVisualStyleBackColor = true;

           this.button3.Click += new System.EventHandler(this.button3_Click);

           //

           // cbbShowType

           //

           this.cbbShowType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;

           this.cbbShowType.FormattingEnabled = true;

           this.cbbShowType.Items.AddRange(new object[] {

           "原图大小显示",

           "适应窗口显示"});

           this.cbbShowType.Location = new System.Drawing.Point(5, 93);

           this.cbbShowType.Name = "cbbShowType";

           this.cbbShowType.Size = new System.Drawing.Size(195, 20);

           this.cbbShowType.TabIndex = 0;

           //

           // txtTime

           //

           this.txtTime.Location = new System.Drawing.Point(5, 63);

           this.txtTime.Name = "txtTime";

           this.txtTime.Size = new System.Drawing.Size(195, 21);

           this.txtTime.TabIndex = 4;

           this.txtTime.Text = "1000";

           this.txtTime.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtTime_KeyDown);

           this.txtTime.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtTime_KeyPress);

           //

           // label2

           //

           this.label2.AutoSize = true;

           this.label2.Location = new System.Drawing.Point(3, 48);

           this.label2.Name = "label2";

           this.label2.Size = new System.Drawing.Size(89, 12);

           this.label2.TabIndex = 3;

           this.label2.Text = "暂停时间(毫秒)";

           //

           // button1

           //

           this.button1.Location = new System.Drawing.Point(143, 20);

           this.button1.Name = "button1";

           this.button1.Size = new System.Drawing.Size(57, 23);

           this.button1.TabIndex = 2;

           this.button1.Text = "浏览...";

           this.button1.UseVisualStyleBackColor = true;

           this.button1.Click += new System.EventHandler(this.button1_Click);

           //

           // txtPicPath

           //

           this.txtPicPath.BackColor = System.Drawing.Color.White;

           this.txtPicPath.Location = new System.Drawing.Point(5, 21);

           this.txtPicPath.Name = "txtPicPath";

           this.txtPicPath.ReadOnly = true;

           this.txtPicPath.Size = new System.Drawing.Size(137, 21);

           this.txtPicPath.TabIndex = 1;

           //

           // label1

           //

           this.label1.AutoSize = true;

           this.label1.Location = new System.Drawing.Point(3, 6);

           this.label1.Name = "label1";

           this.label1.Size = new System.Drawing.Size(65, 12);

           this.label1.TabIndex = 0;

           this.label1.Text = "图片目录:";

           //

           // pictureBox1

           //

           this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;

           this.pictureBox1.Location = new System.Drawing.Point(0, 0);

           this.pictureBox1.Name = "pictureBox1";

           this.pictureBox1.Size = new System.Drawing.Size(406, 394);

           this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

           this.pictureBox1.TabIndex = 0;

           this.pictureBox1.TabStop = false;

           //

           // timer1

           //

           this.timer1.Tick += new System.EventHandler(this.timer1_Tick);

           //

           // Form1

           //

           this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

           this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

           this.BackColor = System.Drawing.Color.WhiteSmoke;

           this.ClientSize = new System.Drawing.Size(616, 420);

           this.Controls.Add(this.splitContainer1);

           this.Controls.Add(this.statusStrip1);

           this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

           this.MaximizeBox = false;

           this.Name = "Form1";

           this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

           this.Text = "图片自动播放器";

           this.Load += new System.EventHandler(this.Form1_Load);

           this.statusStrip1.ResumeLayout(false);

           this.statusStrip1.PerformLayout();

           this.splitContainer1.Panel1.ResumeLayout(false);

           this.splitContainer1.Panel1.PerformLayout();

           this.splitContainer1.Panel2.ResumeLayout(false);

           this.splitContainer1.ResumeLayout(false);

           ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();

           this.ResumeLayout(false);

           this.PerformLayout();

 

       }

 

       #endregion

 

       private System.Windows.Forms.StatusStrip statusStrip1;

       private System.Windows.Forms.SplitContainer splitContainer1;

       private System.Windows.Forms.Button button1;

       private System.Windows.Forms.TextBox txtPicPath;

       private System.Windows.Forms.Label label1;

       private System.Windows.Forms.Label label2;

       private System.Windows.Forms.TextBox txtTime;

       private System.Windows.Forms.ListBox listBox1;

       private System.Windows.Forms.Button button6;

       private System.Windows.Forms.Button button5;

       private System.Windows.Forms.Button button3;

       private System.Windows.Forms.ComboBox cbbShowType;

       private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;

       private System.Windows.Forms.ToolStripStatusLabel tsslPath;

       private System.Windows.Forms.ToolStripStatusLabel tssltotel;

       private System.Windows.Forms.PictureBox pictureBox1;

       private System.Windows.Forms.Timer timer1;

 

   }

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

partial class Form2

  {

      /// <summary>

      /// Required designer variable.

      /// </summary>

      private System.ComponentModel.IContainer components = null;

 

      /// <summary>

      /// Clean up any resources being used.

      /// </summary>

      /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

      protected override void Dispose(bool disposing)

      {

          if (disposing && (components != null))

          {

              components.Dispose();

          }

          base.Dispose(disposing);

      }

 

      #region Windows Form Designer generated code

 

      /// <summary>

      /// Required method for Designer support - do not modify

      /// the contents of this method with the code editor.

      /// </summary>

      private void InitializeComponent()

      {

          this.components = new System.ComponentModel.Container();

          this.pictureBox1 = new System.Windows.Forms.PictureBox();

          this.timer1 = new System.Windows.Forms.Timer(this.components);

          this.pictureBox2 = new System.Windows.Forms.PictureBox();

          ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();

          ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();

          this.SuspendLayout();

          //

          // pictureBox1

          //

          this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Right;

          this.pictureBox1.Image = global::PicPlay.Properties.Resources.图标__57_;

          this.pictureBox1.Location = new System.Drawing.Point(686, 0);

          this.pictureBox1.Name = "pictureBox1";

          this.pictureBox1.Size = new System.Drawing.Size(27, 451);

          this.pictureBox1.TabIndex = 0;

          this.pictureBox1.TabStop = false;

          this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);

          //

          // timer1

          //

          this.timer1.Tick += new System.EventHandler(this.timer1_Tick);

          //

          // pictureBox2

          //

          this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Fill;

          this.pictureBox2.Location = new System.Drawing.Point(0, 0);

          this.pictureBox2.Name = "pictureBox2";

          this.pictureBox2.Size = new System.Drawing.Size(686, 451);

          this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;

          this.pictureBox2.TabIndex = 1;

          this.pictureBox2.TabStop = false;

          this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);

          //

          // Form2

          //

          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

          this.BackColor = System.Drawing.Color.Black;

          this.ClientSize = new System.Drawing.Size(713, 451);

          this.Controls.Add(this.pictureBox2);

          this.Controls.Add(this.pictureBox1);

          this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

          this.Name = "Form2";

          this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

          this.Text = "Form2";

          this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

          this.Load += new System.EventHandler(this.Form2_Load);

          ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();

          ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();

          this.ResumeLayout(false);

 

      }

 

      #endregion

 

      private System.Windows.Forms.PictureBox pictureBox1;

      private System.Windows.Forms.Timer timer1;

      private System.Windows.Forms.PictureBox pictureBox2;

 

  }


版权声明 : 本文内容来源于互联网或用户自行发布贡献,该文观点仅代表原作者本人。本站仅提供信息存储空间服务和不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权, 违法违规的内容, 请发送邮件至2530232025#qq.cn(#换@)举报,一经查实,本站将立刻删除。
原文链接 :
相关文章
  • C#中的时间显示格式(12小时制VS24小时制)
    C#时间显示格式 一起看下: 24小时制 1 this.toolStripStatusLabel1.Text = 您好,欢迎来到XXXX控制系统! + 当前时间: + DateTime.Now.ToString(yyyy-MM-dd HH
  • C#实现图片轮播功能的代码
    实践过程 效果 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 5
  • WPF实现窗体亚克力效果的代码

    WPF实现窗体亚克力效果的代码
    WPF 窗体设置亚克力效果 框架使用大于等于.NET40。 Visual Studio 2022。 项目使用MIT开源许可协议。 WindowAcrylicBlur设置亚克力颜色。 Opacity设置透
  • C#非托管泄漏中HEAP_ENTRY的Size对不上解析

    C#非托管泄漏中HEAP_ENTRY的Size对不上解析
    一:背景 1. 讲故事 前段时间有位朋友在分析他的非托管泄漏时,发现NT堆的_HEAP_ENTRY的 Size 和!heap命令中的 Size 对不上,来咨询是怎么回事?
  • C#中ArrayList 类的使用介绍
    一:ArrayList 类简单说明 动态数组ArrayList类在System.Collecions的命名空间下,所以使用时要加入System.Collecions命名空间,而且ArrayList提供添加,
  • C#使用BinaryFormatter类、ISerializable接口、XmlSeriali

    C#使用BinaryFormatter类、ISerializable接口、XmlSeriali
    序列化是将对象转换成字节流的过程,反序列化是把字节流转换成对象的过程。对象一旦被序列化,就可以把对象状态保存到硬盘的某个位
  • C#序列化与反序列化集合对象并进行版本控制
    当涉及到跨进程甚至是跨域传输数据的时候,我们需要把对象序列化和反序列化。 首先可以使用Serializable特性。 1 2 3 4 5 6 7 8 9 10 11 12 13 14
  • C#事件中关于sender的用法解读

    C#事件中关于sender的用法解读
    C#事件sender的小用法 开WPF新坑了,看了WPF的炫酷界面,再看看winForm实在是有些惨不忍睹(逃)。后面会开始写一些短的学习笔记。 一、什么
  • 在C#程序中注入恶意DLL的方法

    在C#程序中注入恶意DLL的方法
    一、背景 前段时间在训练营上课的时候就有朋友提到一个问题,为什么 Windbg 附加到 C# 程序后,程序就处于中断状态了?它到底是如何实现
  • 基于C#实现一个简单的FTP操作工具
    实现功能 实现使用FTP上传、下载、重命名、刷新、删除功能 开发环境 开发工具: Visual Studio 2013 .NET Framework版本:4.5 实现代码 1 2 3 4 5 6 7
  • 本站所有内容来源于互联网或用户自行发布,本站仅提供信息存储空间服务,不拥有版权,不承担法律责任。如有侵犯您的权益,请您联系站长处理!
  • Copyright © 2017-2022 F11.CN All Rights Reserved. F11站长开发者网 版权所有 | 苏ICP备2022031554号-1 | 51LA统计