private void CreateDirectory()
        {
            m_pathFile = PathFiles.GetPathContact();

            if (!Directory.Exists(Server.MapPath(m_pathFile)))
            {
                Directory.CreateDirectory(Server.MapPath(m_pathFile));
            }

            Session["FileManager"] = m_pathFile;
        }
Пример #2
0
        private void loadInfoaddress()
        {
            string pathFile;
            string strHTMLContent = string.Empty;

            pathFile = Server.MapPath(PathFiles.GetPathContact() + "/contact-printorder.htm");

            if ((File.Exists(pathFile)))
            {
                StreamReader objNewsReader;
                //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default)
                objNewsReader  = new StreamReader(pathFile);
                strHTMLContent = objNewsReader.ReadToEnd();
                objNewsReader.Close();
            }
            Litinfo.Text = strHTMLContent;
        }
        private void showFileHTML1()
        {
            string pathFile;
            string strHTMLContent;

            pathFile = Server.MapPath(PathFiles.GetPathContact() + "/contact-e.htm");

            if ((File.Exists(pathFile)))
            {
                StreamReader objNewsReader;
                //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default)
                objNewsReader  = new StreamReader(pathFile);
                strHTMLContent = objNewsReader.ReadToEnd();
                objNewsReader.Close();

                mrk1.Value = strHTMLContent;
            }
        }
        private void SaveHTMLInfo()
        {
            try
            {
                string htmExt = "-vi.htm";
                //if (lang == 1)
                //{
                //    htmExt = "-vi.htm";
                //}
                //else if (lang == 2)
                //{
                //    htmExt = "-en.htm";
                //}
                //else if (lang == 3)
                //{
                //    htmExt = "-ru.htm";
                //}
                //else if (lang == 4)
                //{
                //    htmExt = "-ch.htm";
                //}
                string htmname = "/contact" + htmExt;

                string       strHTMLFileLocation;
                string       strFileName;
                string       strHTMLContent;
                StreamWriter fsoFile;

                strFileName         = PathFiles.GetPathContact() + htmname;
                strHTMLFileLocation = Server.MapPath(strFileName);
                strHTMLContent      = mrk.Value;

                fsoFile = File.CreateText(strHTMLFileLocation);
                fsoFile.Write(strHTMLContent);
                fsoFile.Close();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
        private void SaveHTMLInfo2()
        {
            try
            {
                string       strHTMLFileLocation;
                string       strFileName;
                string       strHTMLContent;
                StreamWriter fsoFile;

                strFileName         = PathFiles.GetPathContact() + "/contact-ru.htm";
                strHTMLFileLocation = Server.MapPath(strFileName);
                strHTMLContent      = mrk2.Value;

                fsoFile = File.CreateText(strHTMLFileLocation);
                fsoFile.Write(strHTMLContent);
                fsoFile.Close();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
        private void showFileHTML()
        {
            string htmExt = "-vi.htm";
            //if (lang == 1)
            //{
            //    htmExt = "-vi.htm";
            //}
            //else if (lang == 2)
            //{
            //    htmExt = "-en.htm";
            //}
            //else if (lang == 3)
            //{
            //    htmExt = "-ru.htm";
            //}
            //else if (lang == 4)
            //{
            //    htmExt = "-ch.htm";
            //}
            string htmname = "/contact" + htmExt;
            string pathFile;
            string strHTMLContent;

            pathFile = Server.MapPath(PathFiles.GetPathContact() + htmname);

            if ((File.Exists(pathFile)))
            {
                StreamReader objNewsReader;
                //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default)
                objNewsReader  = new StreamReader(pathFile);
                strHTMLContent = objNewsReader.ReadToEnd();
                objNewsReader.Close();

                mrk.Value = strHTMLContent;
            }
        }
Пример #7
0
 protected void Btupmulti_Click(object sender, EventArgs e)
 {
     try
     {
         if (FileUpload1.HasFile)
         {
             HttpFileCollection hfc   = Request.Files;
             List <string>      lpath = new List <string>();
             for (int i = 0; i < hfc.Count; i++)
             {
                 HttpPostedFile hpf = hfc[i];
                 if (hpf.ContentLength > 0)
                 {
                     string pathfile     = Server.MapPath("/data/contact/");
                     string fullpathfile = pathfile + "/" + Path.GetFileName(hpf.FileName);
                     lpath.Add(PathFiles.GetPathContact() + Path.GetFileName(hpf.FileName));
                     if (!Directory.Exists(pathfile))
                     {
                         Directory.CreateDirectory(pathfile);
                     }
                     hpf.SaveAs(fullpathfile);
                 }
             }
             string listimg = string.Empty;
             for (int s = 0; s < lpath.Count; s++)
             {
                 listimg += "<p><img src='" + lpath[s] + "' alt=''/></p>";
             }
             mrk.Value += listimg;
         }
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }