小编Jas*_*Dev的帖子

移植到Java的.NET(C#)开源项目的好例子?(C# - > Java)

我注意到java中已经移植到C#.NET的几个着名项目.一些例子:

  • Hibernate - > NHibernate
  • JUnit - > NUnit
  • 蚂蚁 - > NAnt
  • Lucene - > Lucene.Net,NLucene
  • iText - > iTextSharp
  • log4j - > log4net
  • Quartz - > Quartz.NET

我对相反的情况很好奇:已经移植到java世界的着名.NET项目是什么?

我查看了http://csharp-source.net上的项目列表,但没有看到任何明显的项目.

.net c# java open-source naming-conventions

27
推荐指数
1
解决办法
1423
查看次数

MS Visual Studio 2012 Update 2是否编译C++ 11原始字符串文字?

当2012年11月更新1 CTP问世时,几个博客和channel9视频演示了原始文字作为添加的C++ 11功能.

屏幕截图来自: http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Core-C-/STLCCSeries6:

屏幕截图来自channel9 vid

我将VS2012更新到Update2(2013年4月),版本现在显示为17.00.60315.1但是我收到了编译错误:

错误C2065

在CTP之后是否删除了原始字符串支持,还是忽略了一些明显的东西?

c++ c++11 visual-studio-2012

7
推荐指数
1
解决办法
1858
查看次数

MS CryptoAPI在带有CryptAcquireContext()的Windows XP上不起作用

我使用Microsoft CryptoAPI编写了一些代码来计算SHA-1并使得编译的exe工作在Windows 7,Win Server 2008,Win Server 2003上.但是,当我在Windows XP SP3下运行它时,它不起作用.

我缩小了对CryptAcquireContext()电话的失败.

我注意到之前的帖子谈到了XP的错误命名" ......(Prototype) ",并且必须通过使用WinXP特定宏MS_ENH_RSA_AES_PROV_XP来解决.

我做了XP特定的代码修改,它仍然无法正常工作.(bResult在Win XP上返回0 false,所有其他平台bResult返回1为真.)

我检查了MS_ENH_RSA_AES_PROV_XP,其中包含我在regedit.exe中看到的实际键+字符串值,所以一切看起来都已设置为工作但没有成功.

我是否忽略了一些可以在Windows XP上运行的东西?

我贴了最短的例子来说明这个问题.我使用的是VS2010 C++.

// based on examples from http://msdn.microsoft.com/en-us/library/ms867086.aspx

#include "windows.h"
#include "wincrypt.h"
#include <iostream>
#include <iomanip>  // for setw()

void main()
{
    BOOL bResult;
    HCRYPTPROV hProv;

    // Attempt to acquire a handle to the default key container.
    bResult = CryptAcquireContext(
        &hProv,            // Variable to hold returned handle.
        NULL,              // Use default key container. …
Run Code Online (Sandbox Code Playgroud)

c++ sha1 visual-studio-2010 cryptoapi mscapi

3
推荐指数
1
解决办法
3717
查看次数

如果Get-Member没有列出它,散列表.Get_Item()和.Set_Item()如何工作?

我遇到了一篇Powershell哈希表文章,它使用.Get_Item()和.Set_Item().

两个问题:

1)允许.Get_Item()和.Set_Item()的语法工作的机制是什么?

2)可以运行哪些Powershell命令(如果有的话)来"发现"Get-Member未列出的额外属性和方法?

示例程序:

$h = @{}
$h | get-member
$h | get-member -static

$h.add("copper", 29)

$h["copper"]
$h.item("copper")
$h.get_item("copper")
Run Code Online (Sandbox Code Playgroud)

输出显示Item()但不包括Get_Item()和Set_Item():

   TypeName: System.Collections.Hashtable

Name              MemberType            Definition                                                            
----              ----------            ----------                                                            
Add               Method                System.Void Add(System.Object key, System.Object value)               
Clear             Method                System.Void Clear()                                                   
Clone             Method                System.Object Clone()                                                 
Contains          Method                bool Contains(System.Object key)                                      
ContainsKey       Method                bool ContainsKey(System.Object key)                                   
ContainsValue     Method                bool ContainsValue(System.Object value)                               
CopyTo            Method                System.Void CopyTo(array array, int arrayIndex)                       
Equals            Method                bool Equals(System.Object obj)                                        
GetEnumerator     Method                System.Collections.IDictionaryEnumerator GetEnumerator()              
GetHashCode       Method                int …
Run Code Online (Sandbox Code Playgroud)

powershell

3
推荐指数
1
解决办法
4356
查看次数