📄 postattachment.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web;
namespace CommunityServer.Components {
/// <summary>
/// Summary description for PostAttachment.
/// </summary>
public class PostAttachment {
int length = 0;
int userID = 0;
int postID = 0;
int forumID =0;
DateTime created;
string contentType;
string fileName;
byte[] content;
public PostAttachment() {
}
public PostAttachment (HttpPostedFile postedFile) {
// Get the file length and content type
//
length = postedFile.ContentLength;
contentType = postedFile.ContentType;
// Get the filename
//
fileName = postedFile.FileName.Substring(postedFile.FileName.LastIndexOf("\\") + 1);
// Setup the byte array
//
content = new Byte[length];
// Read in the attachment into a byte array
//
postedFile.InputStream.Read(content, 0, length);
}
public int Length {
get {
return length;
}
set {
length = value;
}
}
public string ContentType {
get {
return contentType;
}
set {
contentType = value;
}
}
public string FileName {
get {
return fileName;
}
set {
fileName = value;
}
}
public Byte[] Content {
get {
return content;
}
set {
content = value;
}
}
public int PostID {
get { return postID; }
set { postID = value; }
}
public int ForumID {
get { return forumID; }
set { forumID = value; }
}
public int UserID {
get { return userID; }
set { userID = value; }
}
public DateTime DateCreated {
get {
return created;
}
set {
created = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -