资源简介
C#实现的电子相册源代码,能实现简单地载入。上下翻页等基本功能
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Windows.Forms;
using System.Drawing;
using System.IO;
using DAL;
namespace BLL
{
public class PhotoLogic
{
private Image img = null;
private byte[] buff = null;
private MemoryStream ms = null;
private FileStream fs = null;
private List allPhotos { get; set; }
private PhotoAccess pa = null;
public PhotoLogic() {
pa = new PhotoAccess();
Refresh();
}
//刷新
public void Refresh()
{
allPhotos = pa.GetAllPhoto();
}
//上传
public bool IsUpLoadSuccess(Photo pht)
{
return pa.UpLoadImage(pht);
}
//返回byte[]
public byte[] GetFilebyte(string filePath)
{
if(File.Exists(filePath)){
fs = new FileStream(filePathFileMode.OpenFileAccess.Read);
int fileLength = (int)fs.Length;
buff = new byte[fileLength];
fs.Read(buff0buff.Length);
fs.Close();
return buff;
}
return null;
}
public Image GetCertainImage(Photo pht)
{
ms = new MemoryStream(pht.Img);
img = Image.FromStream(ms);
ms.Close();
return img;
}
public Photo GetcertainPhoto(ref int picIndex char status)
{
if (status == ‘+‘)
{
picIndex++;
if (picIndex >= allPhotos.Count)
{
MessageBox.Show(“这是最后一张!“);
picIndex--;
}
}
else
{
picIndex--;
if (picIndex <= -1)
{
MessageBox.Show(“这是第一张!“);
picIndex++;
}
}
return allPhotos[picIndex];
}
//浏览图片
public string ReturnPath(OpenFileDialog odlg){
odlg.Filter = “图片文件(*.gif;*.jpg;*.bmp)|*.gif;*.jpg;*.bmp“;
if(odlg.ShowDialog() == DialogResult.OK){
return odlg.FileName;
}
return string.Empty;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 897 2011-11-09 16:24 陈世平\陈世平\sqlcsp.sql
文件 6656 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\bin\Debug\BLL.dll
文件 15872 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\bin\Debug\BLL.pdb
文件 7168 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\bin\Debug\DAL.dll
文件 17920 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\bin\Debug\DAL.pdb
文件 5120 2011-11-09 14:52 陈世平\陈世平\电子相册\BLL\bin\Debug\Model.dll
文件 13824 2011-11-09 14:52 陈世平\陈世平\电子相册\BLL\bin\Debug\Model.pdb
文件 2803 2011-11-09 14:51 陈世平\陈世平\电子相册\BLL\BLL.csproj
文件 819 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\obj\Debug\BLL.csproj.FileListAbsolute.txt
文件 6656 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\obj\Debug\BLL.dll
文件 15872 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\obj\Debug\BLL.pdb
文件 5962 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 5053 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\obj\Debug\ResolveAssemblyReference.cache
文件 2511 2011-11-09 16:30 陈世平\陈世平\电子相册\BLL\PhotoLogic.cs
文件 1362 2011-11-09 09:33 陈世平\陈世平\电子相册\BLL\Properties\AssemblyInfo.cs
文件 881 2011-11-09 15:56 陈世平\陈世平\电子相册\BLL\UserLogic.cs
文件 7168 2011-11-09 16:30 陈世平\陈世平\电子相册\DAL\bin\Debug\DAL.dll
文件 17920 2011-11-09 16:30 陈世平\陈世平\电子相册\DAL\bin\Debug\DAL.pdb
文件 5120 2011-11-09 14:52 陈世平\陈世平\电子相册\DAL\bin\Debug\Model.dll
文件 13824 2011-11-09 14:52 陈世平\陈世平\电子相册\DAL\bin\Debug\Model.pdb
文件 2632 2011-11-09 13:48 陈世平\陈世平\电子相册\DAL\DAL.csproj
文件 2217 2011-11-09 15:27 陈世平\陈世平\电子相册\DAL\DBHelp.cs
文件 643 2011-11-09 16:30 陈世平\陈世平\电子相册\DAL\obj\Debug\DAL.csproj.FileListAbsolute.txt
文件 7168 2011-11-09 16:30 陈世平\陈世平\电子相册\DAL\obj\Debug\DAL.dll
文件 17920 2011-11-09 16:30 陈世平\陈世平\电子相册\DAL\obj\Debug\DAL.pdb
文件 5769 2011-11-09 16:30 陈世平\陈世平\电子相册\DAL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1366 2011-11-09 16:13 陈世平\陈世平\电子相册\DAL\PhotoAccess.cs
文件 1362 2011-11-09 09:34 陈世平\陈世平\电子相册\DAL\Properties\AssemblyInfo.cs
文件 865 2011-11-09 15:56 陈世平\陈世平\电子相册\DAL\UserAccess.cs
文件 447 2011-11-09 11:57 陈世平\陈世平\电子相册\Model\Adminstrator.cs
............此处省略88个文件信息
- 上一篇:C#做的简单的Undo、Redo功能的实现
- 下一篇:房屋售价的数据集kaggle
相关资源
- C#做的简单的Undo、Redo功能的实现
- C#串口编程
- C#图片转换成二进制流并且保存到sq
- C#使用SMTP服务器发送邮件
- C# chart实时数据显示简单工程文件
- C#基于径向灰度算法的表盘指针识别
- 报刊订阅管理 c# Oracle数据库
- C#代码整理(字符串操作、加密解密、
- C# TreeView和ContextMenuStrip右键菜单增删
- 多级 图片压缩工具c#
- 贪吃蛇_c#编程
- C# 等高线图,并找到最优点
- 网上书店系统源码C#+SQLSERVER
- 用C#,面向对象的方试编写的贪吃蛇游
- 用c#写的在wince系统中使用Ping方法
- c#捕获数据包Winpcap
- C#实现 CRC16 MODBUS算法
- c#网上书店管理信息系统
- winform程序仿迅雷
- C# WinForm 邮件发送支持多附件可群发
- C# 计算器 VS2010 完美版
- C# TCP/IP异步通信
- C#利用自带控件实现圆形指示灯
- C#防盗链
- C# DBHelper
- C#计算器程序 VS2010实现
- C# 家庭理财 Winform软件
- WinForm项目:小画笔
- C#Winform无边框窗体_最简洁高效功能全
- 简单项目管理系统
评论
共有 条评论