Tag: c ++

导航到特定的PivotItem

当我点击主页面上的图像时,如何导航到数据透视页面的特定数据透视表? 主页上的图像的XAML代码如下 而Pivot-Page的代码如下 ………. ………. 当我点击主页面上的图像时,我想导航到第五个数据透视表项目。

AutoMapper ForMember忽略不起作用

在MVC应用程序中执行相同实体类型的副本,但希望忽略复制主键(对现有实体进行更新)。 但是,在下面的地图中将Id列设置为忽略不起作用,并且正在覆盖Id。 cfg.CreateMap() .ForMember(dest => dest.Id, option => option.Ignore()) .ForMember(dest => dest.CreatedById, option => option.Ignore()) .ForMember(dest => dest.CreatedOn, option => option.Ignore()) ; 执行地图: existingStratusVendorContact = Mapper.Map(vendorContact); 看到其他答案 ,但看来我已经这样做了。 更新: Fyi,我在Global.asax中创建我的地图,如下所示: Mapper.Initialize(cfg => { cfg.CreateMap() .ForMember(dest => dest.Id, option => option.Ignore()) .ForMember(dest => dest.CreatedById, option => option.Ignore()) .ForMember(dest => dest.CreatedOn, option => option.Ignore()) ; });

Asp.net调用C#层调用Managed C ++调用Native C ++

我的项目结构如下: ASP.NET调用C#层调用托管 C ++调用Native C ++ (我试图避免使用互操作因此这就是托管c ++层的原因)我编写unit testing来测试C#层并且它工作正常。 当我尝试运行asp.net页面时,我得到: “Could not load file or assembly…”错误。 我发现当我复制粘贴Native C ++ dll到“Temporary ASP.NET Files”(到相应的文件夹)时,该网站可以工作。 似乎Managed C ++代码只有在它位于同一个文件夹中才能找到Native C ++代码 – 显然我不能在temp文件中拥有Native dll。 有没有办法在全局范围内设置Native(不适用于System32)? 谢谢你的评论。 归结为一个选项: 这是安全问题 我用代码自己设置服务器并在cassini下运行,但是当我发布它(在iis7下运行)我得到“无法加载文件或程序集……”我正在运行IIS7 ApplicationPoolIdentity,.net 4集成非常感谢Pini。

如何在C#中编组列表

我必须从C#向C ++发送一个列表.C#列表是ListMyList ,C ++代码接受它作为listcppList如何使用marshalas。 谢谢

将C#函数指针传递给C ++ / CLI interop dll

我试图将一个函数指针从C#传递到C ++ / CLI并得到一个Windows编译器错误,指出该语言不支持ManagedTakeCallback函数(C#) – 我在C ++ / CLI互操作中定义了ManagedTakeCallback 。 我的代码看起来像 C#应用程序: namespace ManagedConsoleApplication { class Callback { public delegate double DelegateAdd(double value1, double value2); public static double CallbackAdd(double value1, double value2) { return value1 + value2; } public static DelegateAdd delegateCallback = new DelegateAdd(Callback.CallbackAdd); //declare as static to prevent GC } class Program { […]

当我从现有数据库创建模型时,Entity Framework 4.0生成只读模型

我正在开发一个自定义的ado.net提供程序并使用该提供程序我在Visual Studio 2010中集成了entity framework支持。我正在创建所有可能的映射并从数据库中读取表对象的所有相关元数据。 对于我的测试,表包含主键和其他字段。 当我使用这个表从数据库创建一个模型时,我得到一个包含所有列映射和所有内容的模型,但我也得到以下错误消息: 生成模型时出现警告或错误。 有关详细信息,请参阅错误列表。 在运行应用程序之前必须解决这些问题。 从数据库加载元数据花了00:00:11.4799371。 生成模型花了00:00:04.2751189。 将连接字符串添加到App.Config文件。 编写.edmx文件时间为00:00:00.0005060。 如果我用XML编辑器打开.edmx文件,我会看到以下错误: 它还为表添加了一个带有SELECT …语句的DefiningQuery。 我正在围成一圈寻找解决方案并拼命寻求这个问题的一些帮助。

如何获取具有systray图标的进程

我正在尝试创建应用程序,以获取具有systray图标的进程列表。 我搜索了很多,发现了一些参考文献: http://www.raymond.cc/blog/find-out-what-program-are-running-at-windows-system-tray/ https://superuser.com/questions/708674/how-to-find-out-what-process-a-system-tray-icon-corresponds-to 哪个Windows进程显示给定的任务栏系统托盘图标? https://social.msdn.microsoft.com/Forums/vstudio/en-US/53e27f60-37af-406f-bbdc-45db2bd3dee6/how-to-find-a-system-tray-process https://social.msdn.microsoft.com/Forums/vstudio/en-US/4c4f60ce-3573-433d-994e-9c17f95187f0/finding-which-applications-and-services-are-listed-in-the-system-托盘?论坛= csharpgeneral http://www.codeproject.com/Articles/10497/A-tool-to-order-the-window-buttons-in-your-taskbar 从系统托盘中的图标获取工具提示文本 所有这些都是很好的资源,但对我来说最有用的是3和4。 在1中我们有一个我想要的例子。 我想要有systray图标的进程列表: 应用程序示例称为“AnVir任务管理器” 使用链接6中的代码,我成功遍历系统托盘按钮并查看每个按钮的文本: 但我不知道如何找到与每个trayicon有关的过程。 在代码项目中,他提到可以帮助识别进程的信息是dwData但问题是当我发现Systray中出现的按钮时,其dwData = 0 : 码: Form1.cs的 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace SystrayIcons { public partial class Form1 : Form { public Form1() { Engine.findProcessInSystray(); InitializeComponent(); […]

在WP7.5上使用HTML敏捷包

是否有在WP7.5上使用HTML Agility Pack的参考/指南? 我尝试在VS2010上编译源代码,但我无法引用在本地计算机上创建的DLL。 基本上,我正在寻找一个文本提取器来获取给定URL的文本。 我知道HTML Agility Pack效果最好。 有什么想法/建议吗? 谢谢 :)

在c#项目中导入c ++ dll

我正在将一些c ++ dll导入到ac #project中,我正在使用visual studio 2010.我已经成功导入了使用内置类型的函数,但是当我尝试处理结构时遇到错误。 这是一个简单的例子: c ++代码 typedef long int TDate; typedef struct _TMDYDate { long month; /* In range [1,12] */ long day; /* In range [1-31] */ long year; /* In range [1600-] */ } TMonthDayYear; int JpmcdsDateToMDY (TDate date, /* (I) TDate format */ TMonthDayYear *mdyDate); 我已翻译成c#: [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct […]

PermissiveModifyControl在C#LDAP中抛出DirectoryOperationException

使用System.DirectoryServices.Protocols命名空间在Active Directory组上添加/修改属性。 码: public void UpdateProperties(Dictionary Properties) { List directoryAttributeModifications; // … Code to convert Properties dictionary to directoryAttributeModifications // There is one ‘Add’ modification, to set the ‘description’ of the group ModifyRequest modifyRequest = new ModifyRequest(groupDistinguishedName, directoryAttributeModifications.ToArray()); modifyRequest.Controls.Add(new PermissiveModifyControl()); ModifyResponse response = connection.SendRequest(modifyRequest) as ModifyResponse; PermissiveModifyControl旨在防止代码在描述已存在时失败。 我发现PermissiveModifyControl的唯一信息在这里: http : //msdn.microsoft.com/en-us/library/bb332056.aspx 其中说明: 如果LDAP修改请求尝试添加已存在的属性或尝试删除不存在的属性,则它通常会失败。 使用PermissiveModifyControl ,修改操作成功,而不会抛出DirectoryOperationException错误。 […]