שלום
רציתי לברר על בניית אפליקציות במערכת הפעלת Windows - באיזו שפה והאם יש אפשרות לשמירת נתונים באפליקציה (כמו DB - אבל לא בענן) וכן האם יש אפשרות לשליחת SMS ו/או מייל ו/או הודעה מוקלטת.
אם למישהי יש מושג בעניין, או שיודעת היכן אפשר לברר על כזה דבר, אשמח אם תכתוב כאן.
תודה מראש!
לגבי שליחת אימייל יש בוודאי אפשרות
מצרפת קוד שאני השתמשתי- תעתיקי לדף C# כדי שיסתדר לך האנגלית -עברית
נ.ב. אם לא חשוב לך שזה יהיה דווקא אפליקציה ניתן ליצור אתר שמותאם לנייד
בהצלחה!!!
using System;
using System.Net;
using System.Net.Mail;
using System.Text;
namespace ClassLibrary2
{public class people
{
public int id { get; set; }
public string tz { get; set; }
public string fName{ get; set; }
public string lName { get; set; }
public string email{ get; set; }
}
public class Class1
{
public static bool Attend(string id)
{
people p;
using (var db = new RandEyeDbEntities())//התחברות למסד הנתונים
{
p = db.people.Include("personTypes").FirstOrDefault(x =>x.id.Equals(id));//P-מוצא במסד הנתונים האם האיש עם הקוד שנשלח קיים אם כן שולף ל
}
if (p != null)
{
MailMessage message = new MailMessage();//הודעה חדשה
message.To.Add(p.email);//כתובת לאן לשלוח
message.Subject = "Link to Rand Eye Institute website";//נושא ההודעה
message.From = new MailAddress("randeye7@gmail.com");//כתובת ממנה תשלח ההודעה- יש להגדיר אבטחה נמוכה
StringBuilder sbEmailbody = new StringBuilder();//HTML לאובייקט זה נכניס את תוכן ההודעה- כולל תגיות
sbEmailbody.Append("Hi " + p.fName + "<br/><br/>" +
"Welcome to our Rand Eye Institute <br/><br/>" +
"We are so happy you are here!!! <br/><br/>" +
"here is the link to our appointment real time website <br/><br/> " +
"<a href='http://localhost:4200'>https://Opti-Q</a> <br/><br/>" +
"In our website you will be able to follow your appointment process" +
" and to comunicate with us. <br/><br/>" +
"Have a nice time <br/><br/>" +
"<a href='https://www.randeye.com/about-us/'>welcomed to learn about us in our website</a>"
);
message.IsBodyHtml = true;
message.Body = sbEmailbody.ToString();
SmtpClient smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,//הפורט של המחשב
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
//בפועל מאיזה מייל יישלח המייל
//מייל בעל רמת הרשאה נמוכה
Credentials = new NetworkCredential("randeye7@gmail.com", "Instatute@@7")//כתובת האימייל, קוד של האימייל
};
try
{
smtp.Send(message);
}
catch
{
return false;
}
}
return (true);
}
}
}