public object Clone(object ldc)
{
BinaryFormatter Formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
Formatter.Serialize(stream, ldc);
stream.Position = 0;
object clonedObj = Formatter.Deserialize(stream);
stream.Close();
return clonedObj;
}
调用OUTLOOK预研。用于发送邮件。
参考msdn上
http://msdn.microsoft.com/zh-cn/library/ms269113(v=VS.80).aspx#Y325http://msdn.microsoft.com/zh-cn/library/ms268893(VS.80).aspx添加一个引用,命名空间Microsoft.Office.Interop.Outlook;
ApplicationClass outLookApp = new ApplicationClass();
MailItem newMail = (MailItem)outLookApp.CreateItem(OlItemType.olMailItem);
newMail.To = "
fengzhk@foxmail.com";
newMail.Body = "test内容";
newMail.CC = "
fengzhaokui@163.com";
newMail.Subject = "biaoti主题";
newMail.Display();//弹出outlook
//newMail.Send();//直接发送。不弹出outlook
const string sdllPath = "TaskEdit.dll";
[DllImport(sdllPath)]
internal static extern IntPtr NewTask();
[DllImport(sdllPath)]
internal static extern IntPtr EditTask(string a, int b, int c, string d, string e, string f, string g);
[DllImport(sdllPath)]
internal static extern IntPtr ReadTask(string a, int b, int c, string d, string e, string f, string g);
[DllImport(sdllPath)]
internal static extern IntPtr GetTaskData(ref string a, ref int b, ref int c, ref string d, ref string e, ref string f, ref string g);
[DllImport(sdllPath)]
internal static extern IntPtr OpenANMapEdit(int nTaskId, string pcVersion, int nEditMode, int nWorkMode, string pcPicNo, string pcAdminNo, string pcRange, string pcPicLyer);
DllImport只接受常量const。那么我可以把dll的路径写到环境变量里并重新运行程序就可以找到了。(如用vs运行的话需要重启vs。)
摘要: xaml:<Canvas Name="canvas2" > <Canvas Background="Yellow" Canvas.Left="40" Canvas.Top="20" Width="100" Name="canvas1" Height="54" > <Thumb Name="thumb" Height="20" DragDelta="Thumb_Drag...
阅读全文
摘要: xaml<TextBlock HorizontalAlignment="Left" Text="竖立显示文本" Name="textBlock1" Width="92" />csstring s = textBlock1.Text; int a = s.Length; textBlock1.Text = ""; for (int i = 0; i < a; i++) { Run ...
阅读全文
摘要: wpf如何在一个解决方案里只设有一个资源文件,所有得工程集统一调用这个资源文件。现在我想到得办法是在跟资源文件不在一个工程集中使用资源时调用资源改用动态的DynamicResource调用,这样一来错是不会报了,但是编辑界面时没法看到资源的作用。
阅读全文