Posts

Get started with push notifications in Mobile Services [iOS]

Image
This tutorial walks you through these basic steps to enable push notifications: Generate the certificate signing request Register your app and enable push notifications Create a provisioning profile for the app Configure Mobile Services Add push notifications to the app Update scripts to send push notifications Insert data to receive notifications Generate the Certificate Signing Request file First you must generate the Certificate Signing Request (CSR) file, which is used by Apple to generate a signed certificate. From the Utilities folder, run the Keychain Access tool. Click login in keychain title and Keys in Category, select <key> in Name ,  Click  Keychain Access , expand  Certificate Assistant , then click  Request a Certificate from a Certificate Authority... . Select your  User Email Address  and  Common Name  , make sure that  Saved to disk  is selected, and then click  Continue . Leave t...

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 เป็นต้น ฟัง...