Posts

Showing posts from 2013

Sending email .Net [Gmail]

Send email mail1 to mail2 {             string src_address = "mail1@gmail.com";             string dest_address = "mail2@gmail.com";             MailMessage myMail = new MailMessage();             NetworkCredential Cred = new NetworkCredential(src_address, "password");             myMail.From = new MailAddress(src_address);                       myMail.To.Add(dest_address);             myMail.Subject = "Test send mail message";             myMail.Body = "Hi !!";             SmtpClient smtpMail = new SmtpClient();             smtpMail.Credentials = Cred;             smtpMail.Host = "smtp.gmail.com";       ...

MVC คืออะไร?

Image
ความหมายของ MVC ก่อนอื่นผมขอเริ่มต้นที่ความหมายของ OOP ก่อน การเขียนโปรแกรมแบบ OOP คือ การแบ่งโปรแกรมหรือแอพพลิเคชันออกเป็นออบเจกต์ย่อยๆ แต่ละออบเจกต์ทำหน้าที่หลักเพียงอย่างเดียว สุดท้ายทุกๆออบเจกต์ทำงานร่วมกันออกมาเป็นแอพพลิเคชันที่สมบูรณ์  แล้วในความเป็นจริงเราจะแบ่งออบเจกต์ด้วยหลักการใด? อันนี้ก็ขึ้นอยู่กับปัจจัยต่างๆและการออกแบบ แต่แล้วมันเกี่ยวอะไรกับ MVC หล่ะ เกี่ยวแน่นอนครับ เพราะ MVC คือหลักการออกแบบ (Design Pattern) รูปแบบหนึ่งนั่นเอง ซึ่งเป็นที่นิยมมากในการออกแบบและประยุกต์ใช้กับเว็บแอพพลิเคชัน ชื่อเต็มๆของมันคือ Model-View-Controller ซึ่งเจ้า MVC นี้จะแบ่งแอพพลิเคชันตามบทบาทหน้าที่ (Roles of Objects) โดยแบ่งออกเป็น 3 บทบาทด้วยกันคือ Model (M) View (V) Controller (C) Model  คือออบเจกต์ที่ทำหน้าเป็นตัวแทนของข้อมูล ไม่ว่าข้อมูลจะถูกจัดเก็บในรูปแบบใดในระบบฐานข้อมูลหรือในไฟล์ เมื่อข้อมูลนั้นถูกโหลดเข้ามาในแอพพลิเคชัน เราจะเปลี่ยนมันให้อยู่ในรูปของออบเจกต์ และเราเรียกบทบาทของออบเจกต์นี้ว่า " Model " ยกตัวอย่างเช่นออบเจกต์ Customer, Employee, Product เป็นต้น ฟัง...

List of iOS devices

Image
List of iOS devices From Wikipedia, the free encyclopedia The reverse sides of an  original iPhone , iPhone 3G , and  iPhone 4 . A size comparison of three iPhones, an original iPad , and a  Magic Mouse . This is a list and comparison of devices prodesigned and marketed by  Apple Inc.  (formerly Apple Computer Inc.) that run a  Unix-like   operating system  named  iOS , often referred to simply as  iDevices . The devices include the  iPhone  multimedia smartphone , the  iPod Touch , which is similar to the iPhone but has no  cell phone  hardware, and the  iPad   tablet computer . All three devices function as  digital audio  and  portable media  players and  Internet  clients. The  Apple TV , which ran iOS from the second generation of hardware onwards, is a  set-top box  for streaming local media to a connected television set, an...