⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yiduduanxin.cs

📁 功能比较强大的短信收发系统功能比较强大。
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;

namespace ShInfo
{
	/// <summary>
	/// yiduduanxin 的摘要说明。
	/// </summary>
	public class yiduduanxin : System.Windows.Forms.Form
	{
		private System.Windows.Forms.ListBox listBox1;
		private System.Windows.Forms.Button btnClear;
		private System.Windows.Forms.Button btnClose;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		private Sunisoft.IrisSkin.SkinEngine skinEngine1;
		public yiduduanxin()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			this.skinEngine1.SkinFile = "DiamondGreen.ssk";
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(yiduduanxin));
			this.skinEngine1 = new Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
			this.listBox1 = new System.Windows.Forms.ListBox();
			this.btnClear = new System.Windows.Forms.Button();
			this.btnClose = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// skinEngine1
			// 
			this.skinEngine1.SerialNumber = "";
			this.skinEngine1.SkinFile = null;
			// 
			// listBox1
			// 
			this.listBox1.Font = new System.Drawing.Font("华文楷体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.listBox1.ForeColor = System.Drawing.Color.Magenta;
			this.listBox1.ItemHeight = 18;
			this.listBox1.Location = new System.Drawing.Point(0, 0);
			this.listBox1.Name = "listBox1";
			this.listBox1.Size = new System.Drawing.Size(472, 238);
			this.listBox1.TabIndex = 0;
			// 
			// btnClear
			// 
			this.btnClear.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnClear.Location = new System.Drawing.Point(128, 264);
			this.btnClear.Name = "btnClear";
			this.btnClear.TabIndex = 2;
			this.btnClear.Text = "清除(&C)";
			this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
			// 
			// btnClose
			// 
			this.btnClose.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.btnClose.Location = new System.Drawing.Point(264, 264);
			this.btnClose.Name = "btnClose";
			this.btnClose.TabIndex = 3;
			this.btnClose.Text = "关闭(&E)";
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// yiduduanxin
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(472, 301);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.btnClear);
			this.Controls.Add(this.listBox1);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.Name = "yiduduanxin";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "已读短信";
			this.Load += new System.EventHandler(this.yiduduanxin_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void btnClose_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void yiduduanxin_Load(object sender, System.EventArgs e)
		{
			ArrayList a4=new ArrayList();
			Recvivemessagebox w=new Recvivemessagebox();
			a4=w.Yreadinfo();
			for(int i=0;i<a4.Count;i++)
			{
				this.listBox1.Items.Add(a4[i]);
			}
		}

		private void btnClear_Click(object sender, System.EventArgs e)
		{
			ArrayList al=new ArrayList();
			if(this.listBox1.SelectedItem!=null)
			{
				al.Remove(this.listBox1.SelectedItem);
				File.Delete("已读信息.txt");
				FileStream fs=null;
				StreamWriter sw=null;
				fs=new FileStream("已读信息.txt",FileMode.Create);
				sw=new StreamWriter(fs);
				if(al!=null)
				{
					foreach(string a in al)
					{
						sw.WriteLine(a);
					}
				}
				sw.Close();
				fs.Close();
				this.listBox1.Items.Remove(this.listBox1.Text);
				MessageBox.Show("删除成功","提示:");
			}
			else
			{
				MessageBox.Show("请选中一个联系人","提示:");
			}	
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -