//读取下载的文件流
if (fileStream.CanRead)
{
int length;
byte[] buffer = new byte[10000];
length = fileStream.Read(buffer, 0, 10000);
long dataToRead = fileLength;
if (!Directory.Exists(@"c:\downFile"))
{
Directory.CreateDirectory(@"c:\downFile");
}
FileStream fstr = new FileStream(@"c:\downFile\" + _FileName, FileMode.Create, FileAccess.Write);
fstr.Write(buffer, 0, length);
fstr.Close();
MessageBox.Show(@"File has been downloaded to c:\downFile\! ",
"RHDB - about Attachment", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
HttpPostedFileBase f = Request.Files["txtFile"];
HttpFileCollection collection = System.Web.HttpContext.Current.Request.Files;
var collection = charts.OrderByDescending(item => item.Value).Take(10).ToList();
Dictionary<string, int> dictionary = new Dictionary<string, int>();
foreach (var item in collection)
{
dictionary.Add(item.Key, item.Value);
}
//获取角色的ID
function getRoleID(checkBoxName) {
var selectRoleID = "";
$("input[name='" + checkBoxName + "']").each(
function() {
if ($(this).attr('checked') == true) {
selectRoleID += $(this).val() + ",";
}
}
);
return selectRoleID;
}
$("input[type='checkbox']:checked").attr("value");
代码