asp.net 上传文件
if (FileUpload1.HasFile)
{
string fileContentType = FileUpload1.PostedFile.ContentType;
//限制上传的类型 txt/jpg/word
if (fileContentType == "text/plain"||"image/jpg"||"application/msword"||"image/gif" )
{
string name = FileUpload1.PostedFile.FileName; // 客户端文件路径
FileInfo file = new FileInfo(name);
string fileName = file.Name; // 文件名称
string webFilePath = Server.MapPath("~/upload/" + fileName); // 服务器端文件路径
zsInfo.Word = webFilePath;
if (!File.Exists(webFilePath))
{
try
相关文档:
我这是拿来别人用的,为了方便以后自己看吧,看对大家有帮忙吗
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace AppBLL
{
public class ShutDown
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
......
回顾上一篇,我们可以了解到以下内容:
1.默认情况下,只能上传小于4M的文件,如果我们要上传大文件的话,可以通过更改maxRequestLength来提高限制。
2.Asp.net 1.X 通过改变maxRequestLength可以增大上传的限制,但是由于需要将用户请求的实体内容完全载入内存后再处理,会大大影响服务器性能。
3.Asp.net 2.0 则会在用户请 ......
Flex
与 Asp.Net 通过 Remoting 方式进行通讯
Flex 与 Asp.Net 通过 Remoting 方式进行通讯 (一)http://hi.baidu.com/tsengyuen/blog/item/644e98a3353f7287471064ef.html
Flex 与 Asp.Net 通过 Remoting 方式进行通讯 (二)http://hi.baidu.com/tsengyuen/blog/item/af02730d58d6d7266059f3e8.html
Flex 与 Asp.Net 通 ......
///方法
public static List<FeesItemInfo> selectAll()
{
List<FeesItemInfo> list = new List<FeesItemInfo>();
& ......