一:展示图片

每秒换一次图片,一共六十张图片,00-59

二:代码

a,设计代码

  1. namespace timePicture
  2. {
  3. partial class Form1
  4. {
  5. /// <summary>
  6. /// 必需的设计器变量。
  7. /// </summary>
  8. private System.ComponentModel.IContainer components = null;
  9.  
  10. /// <summary>
  11. /// 清理所有正在使用的资源。
  12. /// </summary>
  13. /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
  14. protected override void Dispose(bool disposing)
  15. {
  16. if (disposing && (components != null))
  17. {
  18. components.Dispose();
  19. }
  20. base.Dispose(disposing);
  21. }
  22.  
  23. #region Windows 窗体设计器生成的代码
  24.  
  25. /// <summary>
  26. /// 设计器支持所需的方法 - 不要
  27. /// 使用代码编辑器修改此方法的内容。
  28. /// </summary>
  29. private void InitializeComponent()
  30. {
  31. this.components = new System.ComponentModel.Container();
  32. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  33. this.timer1 = new System.Windows.Forms.Timer(this.components);
  34. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  35. this.SuspendLayout();
  36. //
  37. // pictureBox1
  38. //
  39. this.pictureBox1.Location = new System.Drawing.Point(, );
  40. this.pictureBox1.Name = "pictureBox1";
  41. this.pictureBox1.Size = new System.Drawing.Size(, );
  42. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
  43. this.pictureBox1.TabIndex = ;
  44. this.pictureBox1.TabStop = false;
  45. //
  46. // timer1
  47. //
  48. this.timer1.Enabled = true;
  49. this.timer1.Interval = ;
  50. this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
  51. //
  52. // Form1
  53. //
  54. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  55. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  56. this.ClientSize = new System.Drawing.Size(, );
  57. this.Controls.Add(this.pictureBox1);
  58. this.Name = "Form1";
  59. this.Text = "Form1";
  60. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  61. this.ResumeLayout(false);
  62.  
  63. }
  64.  
  65. #endregion
  66.  
  67. private System.Windows.Forms.PictureBox pictureBox1;
  68. private System.Windows.Forms.Timer timer1;
  69. }
  70. }

b,逻辑代码

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace timePicture
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. /// <summary>
  19. /// 事件
  20. /// </summary>
  21. /// <param name="sender"></param>
  22. /// <param name="e"></param>
  23. private void timer1_Tick(object sender, EventArgs e)
  24. {
  25. //y 表示年 M 月 d 日 HH 24小时制 m 分 s 秒
  26. //this.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  27. string path=this.Text =Application.StartupPath+"\\image\\" +DateTime.Now.ToString("ss")+".jpg";
  28. this.pictureBox1.Image = Image.FromFile(path);
  29. }
  30. }
  31. }

datetime和timer的使用(小小幻灯片)的更多相关文章

  1. C# System.Threading.Timer 使用方法

    public class TimerHelper { System.Threading.Timer timer; public TaskSendMMS tasksendmms { get; set; ...

  2. .NET中的三种Timer的区别和用法

    最近正好做一个WEB中定期执行的程序,而.NET中有3个不同的定时器.所以正好研究研究.这3个定时器分别是: //1.实现按用户定义的时间间隔引发事件的计时器.此计时器最宜用于 Windows 窗体应 ...

  3. .NET中的三种Timer的区别和用法(转)

      最近正好做一个WEB中定期执行的程序,而.NET中有3个不同的定时器.所以正好研究研究.这3个定时器分别是: //1.实现按用户定义的时间间隔引发事件的计时器.此计时器最宜用于 Windows 窗 ...

  4. 转:.NET中的三种Timer的区别和用法(转)

    //1.实现按用户定义的时间间隔引发事件的计时器.此计时器最宜用于 Windows 窗体应用程序中,并且必须在窗口中使用. System.Windows.Forms.Timer // 2.提供以指定的 ...

  5. 【转】.NET中的三种Timer的区别和用法

    最近正好做一个WEB中定期执行的程序,而.NET中有3个不同的定时器.所以正好研究研究.这3个定时器分别是: //1.实现按用户定义的时间间隔引发事件的计时器.此计时器最宜用于 Windows 窗体应 ...

  6. Forms.Timer、Timers.Timer、Threading.Timer的研究

    .NET Framework里面提供了三种Timer System.Windows.Forms.Timer System.Timers.Timer System.Threading.Timer 一.S ...

  7. [Python] iupdatable包:Timer 类使用介绍

    iudatable包是我对常用函数进行的封装后发布的一个python包,教程汇总目录: [Python] iupdatable包使用说明 安装 iupdatable 包 pip install iup ...

  8. jQuery简单倒计时插件

    一. 效果预览 二. 实现 1. 按照特定的类结构布局. 2. 需要先引入jQuery,再引入此文件. /** * Author: CC11001100 * * 简单倒计时 * * 1. 支持页面内同 ...

  9. c# 中定时器的用法

    来源于:http://blog.sina.com.cn/s/blog_62c501440100fog1.html System.Threading.Timer 是一个非常常用的定时器类,关于这个类的使 ...

随机推荐

  1. onContextItemSelected 用法

    http://blog.csdn.net/kavensu/article/details/8045041 onCreateOptionsMenu :此方法为创建菜单方法,这个菜单就是你在点击手机men ...

  2. java异常类的使用

    1.异常的概念 什么是异常?程序出错分为两部分,编译时出粗和运行时出错.编译时出错是编译器在编译源码时发生的错误: 运行时出错是在编译通过,在运行时出现的错误.这种情况叫异常. 例如:数组越界,除数为 ...

  3. angularjs kindEditor 中content获得不到值

    angularjs kindEditor 中content获得不到值 需要修改下angular-kindeditor.js angular-kindeditor.js if (KindEditor) ...

  4. Linux软件

    网上下载:Chrome Browser for Linux; sqlite;  WPS; symbol-fonts; 软件中心:Terminator; Code::Blocks IDE;  新立得软件 ...

  5. Linq 调试

    void Main() { var MyMonitor = new Devart.Data.Oracle.OracleMonitor(); MyMonitor.IsActive = true; var ...

  6. xceed wpf datagrid

    <!--*********************************************************************************** Extended ...

  7. Linux 删除文件夹

    inux删除目录很简单,很多人还是习惯用rmdir 1.直接rm就可以了:rm -rf 目录名字 -r 就是向下递归,不管有多少级目录,一并删除-f 就是直接强行删除,不作任何提示的意思

  8. 如何制作css3的3d动画——以骰子旋转为例,详解css3动画属性

    首先先来看两个用css3实现的炫酷的3d动画效果 1 2 3 4 5   6 你没看错,这个炫酷的效果都是用css3实现的. 下面是动画实现所需要用到的几个css3属性. 1.perspective: ...

  9. Servlet(三)

    重定向 服务器向浏览器发送一个302状态码以及一个Location消息头(该消息头的值是一个地址,称之为重定向地址),浏览器收到后会立即向重定向的地址发出请求,使用相应对象的API方法实现(respo ...

  10. POJ 1734.Sightseeing trip (Floyd 最小环)

    Floyd 最小环模板题 code /* floyd最小环,记录路径,时间复杂度O(n^3) 不能处理负环 */ #include <iostream> #include <cstr ...