Пример #1
0
 public static string SaveSmallImages(HtmlInputFile File1, string SaveFileFolder)
 {
     string str = string.Empty;
     if (File1.Value != "")
     {
         string extension = Path.GetExtension(File1.Value);
         string str3 = Guid.NewGuid().ToString("n");
         string str4 = str3 + extension;
         string str5 = "s" + str3 + extension;
         string path = HttpContext.Current.Server.MapPath(SaveFileFolder) + str4;
         string str7 = HttpContext.Current.Server.MapPath(SaveFileFolder) + str5;
         string str8 = SaveFileFolder + str5;
         if (File.Exists(path))
         {
             Location.MsgBox("已存在相同文件名,请重新上传JPG图片!");
             return str;
         }
         ReadXML dxml = new ReadXML();
         string str9 = HttpContext.Current.Server.MapPath("UpFiles/");
         if (!Directory.Exists(str9))
         {
             Directory.CreateDirectory(str9);
         }
         File1.PostedFile.SaveAs(path);
         pic_0(path, str7, dxml.smallPicWidth, dxml.smallPicHeight);
         str = str8;
         if (File.Exists(path))
         {
             File.Delete(path);
         }
     }
     return str;
 }
Пример #2
0
 public static string SQLConnStr()
 {
     ReadXML dxml = new ReadXML();
     return ("server=" + dxml.DBserver + ";database=" + dxml.Dbase + ";Pooling=true;Min Pool Size=0;Max Pool Size=1000;packet size=4096;uid=" + dxml.DbUserId + ";pwd=" + dxml.DbUserPSW + ";");
 }