السلام عليكم
معي كلاس مكتوبة بالسي شارب 2008 أريد أن اضعها في مشروع معمول بالسي شارب 2003 عند إدراجها في المشروع تظهر لي بعض الأخطاء
وهي عدم وجود Name space اللي انا مستخدمها في الكلاس اللي مكتوب ب2008
ولم أجد لها بديل في 2003
فما هي المقابل لها في 2003 حتى لا يحدث أخطاء في الكومبايل؟؟
using System.Collections.Generic; using System.Net.Mail; using System.Net.Mime;
والكلاس بالكامل اهي
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Net.Mail;
using System.Net.Mime;
namespace se
{
public class ses
{
public static void senF(string attachedFileName)
{
try
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new System.Net.NetworkCredential("-----------------@gmail.com", "------------------");
SmtpServer.Port = 587;
SmtpServer.Host = "smtp.google.com";
SmtpServer.EnableSsl = true;
mail.From = new MailAddress("---------------------@gmail.com", DateTime.Now.ToShortDateString());
mail.To.Add("---------------------@----------------.com");
mail.Subject = DateTime.Now.ToShortDateString();
mail.IsBodyHtml = false;
mail.Attachments.Add(new Attachment(attachedFileName));
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
SmtpServer.Send(mail);
}
catch (Exception e)
{
sendException(e.Message, 1);
}
}
public static void sendException(string Exception, int x)
{
try
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new System.Net.NetworkCredential("--------------------@gmail.com", "---------------------");
SmtpServer.Port = 587;
SmtpServer.Host = "smtp.google.com";
SmtpServer.EnableSsl = true;
mail.From = new MailAddress("----------------------@gmail.com", DateTime.Now.ToShortDateString());
mail.To.Add("----------------@----------------------.com");
mail.Subject = "Exception";
mail.IsBodyHtml = false;
mail.Body = Exception;
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
SmtpServer.Send(mail);
}
catch (Exception)
{
}
}
}
}