[个人整理]9512个PNG图标-2/2
【解压码】http://blog.csdn.net/mr_qu
[个人整理的9512个PNG图标,背景透明,120*120像素,可用于网页制作,客户端开发]
ShowHideTest
同事需要做一个类似OutLook的桌面程序,有类似QQ好友列表一样的功能,点击按钮以后展开下面的内容,其他内容收起,网上查了下,都需要第三方控件,其实用tablelayoutpanel就够了,自己做了一个小测试,代码比较简单,但是基本实现了这个功能了
tingMailSendSystem--仿OutLook的邮件编辑面板
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;
using System.IO;
namespace CNPOPSOFT.Controls.Demo
{
public partial class MailSender : Form
{
private string filenameok = "";
private string filenameno = "";
private MailMessage message;
public MailSender()
{
InitializeComponent();
}
private void buttonSend_Click(object sender, EventArgs e)
{
string[] ls = System.IO.File.ReadAllLines
(this.textBoxTo.Text.Trim(), System.Text.Encoding.Default);
if (ls.Length > 0)
{
string folder = Application.StartupPath + "\\Logs";
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
filenameok = folder + "\\" + DateTime.Now.ToString
("yyyy_MM_dd HH mm ss") + "_ok.txt";
filenameno = folder + "\\" + DateTime.Now.ToString
("yyyy_MM_dd HH mm ss") + "_no.txt";
for (int a = 0; a < ls.Length; a++)
{
bool s = false;
if (ls[a].ToString().Length < 1 && ls[a].ToString
().IndexOf("@") == -1)
continue;
else
s = Sendemail(ls[a].ToString());
if (s)
{
FileStream fs1 = new FileStream(filenameok,
FileMode.Append, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs1);
sw.WriteLine("\r\n");
sw.WriteLine
("*******************************");
sw.WriteLine(ls[a].ToString());
sw.WriteLine(DateTime.Now.ToString());
sw.WriteLine
("*******************************");
sw.Close();
fs1.Close();
}
else
{
FileStream fs2 = new FileStream(filenameno,
FileMode.Append, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs2);
sw.WriteLine("\r\n");
sw.WriteLine("******************************");
sw.WriteLine(ls[a].ToString());
sw.WriteLine(DateTime.Now.ToString());
sw.WriteLine("******************************");
sw.Close();
fs2.Close();
}
}
}
if (File.Exists(filenameok))
this.textBox3.Text = filenameok;
else
this.textBox3.Text = "全部没有发送成功!";
if (File.Exists(filenameno))
this.textBox4.Text = filenameno;
else
this.textBox4.Text = "全部发送成功!";
}
public bool Sendemail(string toemail)
{
bool flag = false;
MailMessage message = BuildMessage(toemail);
string host = "smtp." + message.From.Host;
int port = 25;
string userid = this.textBox1.Text;
string password = this.textBox2.Text;
SmtpClient smtp = new SmtpClient(host, port);
smtp.Credentials = new NetworkCredential(userid, password);
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
try
{
smtp.Send(message);
flag = true;
//MessageBox.Show("发送成功!", "示例",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
flag = false;
//MessageBox.Show("发送失败!\r\n" + ex.Message, "示
例", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
return flag;
}
private MailMessage BuildMessage(string toemail)
{
string from = this.textBox1.Text;
//string to = textBoxTo.Text;
string subproject = textBoxSubject.Text;
string[] images =null;
string body ="";
if (this.textBox5.Text.Length < 1)
{
images = htmlEditor1.Images;
body = htmlEditor1.Text;
}
else
{
body = System.IO.File.ReadAllText
(this.textBox5.Text.ToString(), Encoding.Default);
}
message = new MailMessage();
message.From = new MailAddress(from);
message.To.Add(new MailAddress(toemail));
message.Subject = subproject;
message.IsBodyHtml = true;
if (images != null)
{
for (int i = 0, count = images.Length; i < count; ++i)
{
string image = images[i];
if (image.Trim() == "")
{
continue;
}
if (!image.StartsWith("file"))
{
continue;
}
string path = Path.GetFullPath(image.Replace("%20",
" ").Replace("file:///", ""));
string cid = string.Format("image_{0:00}", i);
Attachment attach = new Attachment(path);
attach.Name = Path.GetFileName(path);
attach.ContentId = cid;
message.Attachments.Add(attach);
body = body.Replace(path, string.Format("cid:{0}",
cid));//5+1+a+s+p+x
}
}
message.Body = body;
return message;
}
private void btnadd_Click(object sender, EventArgs e)
{
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
this.textBoxTo.Text = this.openFileDialog1.FileName;
}
private void button1_Click(object sender, EventArgs e)
{
if (this.textBox3.Text.Length > 25)
System.Diagnostics.Process.Start(filenameok);
}
private void button2_Click(object sender, EventArgs e)
{
if (this.textBox4.Text.Length > 25)
System.Diagnostics.Process.Start(filenameno);
}
private void button3_Click(object sender, EventArgs e)
{
if (this.openFileDialog2.ShowDialog() == DialogResult.OK)
this.textBox5.Text = this.openFileDialog2.FileName;
}
}
}
非常好用的C#控件,客户端开发必备
DevComponents.DotNetBar2.dll
解压后直接可用,样式比较不错,功能也很多~
C#工具栏源代码
#region 漂浮状态
private ToolStripFloatWindow floatWindow;
public ToolStripFloatWindow FloatWindow
{
get
{
return this.floatWindow;
}
set
{
floatWindow = value;
if (FloatWindow != null)
{
floatWindow.LocationChanged += new EventHandler(floatWindow_LocationChanged);
floatWindow.FormClosing += new FormClosingEventHandler(floatWindow_FormClosing);
}
}
}
public bool isFloating
{
get
{
return (floatWindow != null);
}
}
private ToolStripPanel tsPanel;
public ToolStripPanel ToolStripPanel
{
get
{
return this.tsPanel;
}
set
{
tsPanel = value;
}
}
#endregion
#region 漂浮实现
private void floatWindow_LocationChanged(object sender, EventArgs e)
{
//当floatwindws的位置移动到 toolstrippanel中时,将this放置到 toolstripPanel上
if (this.floatWindow == null)
{
return;
}
Point currentPt = new Point(floatWindow.Location.X, floatWindow.Location.Y);
Point minpt = this.tsPanel.PointToScreen(tsPanel.Location);
Point maxpt;
if(this.tsPanel.Height <= 20){
maxpt = new Point(minpt.X + this.tsPanel.Width, minpt.Y + 20);
}else{
maxpt = new Point(minpt.X + this.tsPanel.Width, minpt.Y + this.tsPanel.Height);
}
if ((currentPt.X > minpt.X) && (currentPt.X < maxpt.X) && (currentPt.Y > minpt.Y) && (currentPt.Y < maxpt.Y))
{
this.floatWindow.Controls.Remove(this);
this.tsPanel.SuspendLayout();
this.tsPanel.Controls.Add(this);
this.Location = this.tsPanel.PointToClient(currentPt);
this.tsPanel.ResumeLayout();
this.floatWindow.Dispose();
this.floatWindow = null;
}
}
private void MyToolStrip_EndDrag(object sender, EventArgs e)
{
//判断移出时
if (this.tsPanel == null)
{
MessageBox.Show("请先设置ToolStripPanel属性");
return;
}
Point endPoint = Cursor.Position;
int openX, openY;
openX = endPoint.X;
openY = endPoint.Y;
Point clientPt = this.tsPanel.Parent.PointToClient(endPoint);
if (clientPt.Y > tsPanel.Height)
{
ToolStripFloatWindow fw = new ToolStripFloatWindow();
this.tsPanel.Controls.Remove(this);
fw.Controls.Add(this);
this.Left = 0;
this.Top = 0;
this.FloatWindow = fw;
Point newLoc = new Point(openX, openY);
fw.Show();
fw.Location = newLoc;
fw.SetBounds(newLoc.X, newLoc.Y, this.ClientSize.Width, this.ClientSize.Height);
}
}
private void floatWindow_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
}
private void MyToolStrip_SizeChanged(object sender, EventArgs e)
{
if (this.isFloating)
{
this.floatWindow.Width = this.ClientSize.Width;
}
}
#endregion
c#对话框编程,菜单栏工具栏状态栏
对话框、菜单栏、工具栏、状态栏,很好用的~
Office工具栏图标
2500个图标,超全,用于开发仿MS Office的客户端的朋友使用
不知道怎么添加略图~
ServiceBook_XiaoWei_bbercn
非常好用的BB的SB,xiaowei做的,里面有很多的浏览器~
light_cursor
大量的鼠标图标,无需再自己创建,可直接使用
BerryJoose
很好的BB内存管理工具,下载后直接安装即可!
SetupAddFlow
/Bin文件夹包括案例和DLL库
/Doc文件夹包括说明文档和开发文档
/Src文件夹包括C# samples,Extension和VB samples
C# A-Star自动寻路算法
外国经典A*算法
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER REMAINS UNCHANGED.
AddFlow for .Net
AddFlow 源代码,但是没有注释,里面很多变量的命名都很随意,看起来十分麻烦,不知道哪位大侠能帮写以下注释,小弟新C#er,接到的任务是要在这个控件的基础上开发,所以先要看懂,看了三四天了也稀里糊涂的,希望有明白人能帮忙解决一下,或者谁有相似的流程图功能的开源控件可以分享一下,谢谢了!