if (op.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (op.CheckPathExists) { string CorrectFilename = System.IO.Path.GetFileName(op.FileName); SqlCommand cmd = new SqlCommand("UPDATE Command_Prices set c_photo='\\image\\" + CorrectFilename + "'where id ='" + txt1.Text + "')", con); cmd.ExecuteNonQuery(); con.Close(); string path = Application.StartupPath.Substring(0, (Application.StartupPath.Length - 10)); System.IO.File.Move(op.FileName, path + "\\image\\" + CorrectFilename); MessageBox.Show("Successfully Uploaded"); } }
SqlCommand cmd = new SqlCommand("UPDATE Command_Prices set c_photo='\\image\\" + CorrectFilename + "'where id =" + txt1.Text, con);
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง