Tag: vb.net

排序文件夹名称数组,如Windows资源管理器(数字和字母) – VB.NET

我正在自杀并脱水试图让这个数组排序。 我有一个包含生成目录的数组; Dim Folders()As String = Directory.GetDirectories(RootPath) 我需要对它们进行排序,以便它们在win7 / vista中的Windows资源管理器中显示。 – 文件夹名称的数字和字母顺序。 文件夹名称包含字母和数字,有时仅包含字母或仅包含数字。 简单的Array.Sort(文件夹)结果 C:\inetpub\wwwroot\rootpath\1 C:\inetpub\wwwroot\rootpath\10 C:\inetpub\wwwroot\rootpath\100 C:\inetpub\wwwroot\rootpath\1004 C:\inetpub\wwwroot\rootpath\101 C:\inetpub\wwwroot\rootpath\11 C:\inetpub\wwwroot\rootpath\12 C:\inetpub\wwwroot\rootpath\2 C:\inetpub\wwwroot\rootpath\3 C:\inetpub\wwwroot\rootpath\4 C:\inetpub\wwwroot\rootpath\5 C:\inetpub\wwwroot\rootpath\6 C:\inetpub\wwwroot\rootpath\7 C:\inetpub\wwwroot\rootpath\8 C:\inetpub\wwwroot\rootpath\87skjnd C:\inetpub\wwwroot\rootpath\89sdf93kmw3 C:\inetpub\wwwroot\rootpath\9 C:\inetpub\wwwroot\rootpath\ad C:\inetpub\wwwroot\rootpath\bin C:\inetpub\wwwroot\rootpath\dark C:\inetpub\wwwroot\rootpath\erk C:\inetpub\wwwroot\rootpath\jkh23978yoaslkd3 C:\inetpub\wwwroot\rootpath\lk2309as C:\inetpub\wwwroot\rootpath\work C:\inetpub\wwwroot\rootpath\zone 我想拥有的(以及Windows资源管理器显示的内容)是…… C:\inetpub\wwwroot\rootpath\1 C:\inetpub\wwwroot\rootpath\2 C:\inetpub\wwwroot\rootpath\3 C:\inetpub\wwwroot\rootpath\4 C:\inetpub\wwwroot\rootpath\5 C:\inetpub\wwwroot\rootpath\6 C:\inetpub\wwwroot\rootpath\7 C:\inetpub\wwwroot\rootpath\8 C:\inetpub\wwwroot\rootpath\9 C:\inetpub\wwwroot\rootpath\10 C:\inetpub\wwwroot\rootpath\11 C:\inetpub\wwwroot\rootpath\12 C:\inetpub\wwwroot\rootpath\87skjnd C:\inetpub\wwwroot\rootpath\89sdf93kmw3 C:\inetpub\wwwroot\rootpath\100 […]

使用Reflection(DotNET)查找程序集中的所有命名空间

我有一个程序集(作为ReflectionOnly加载),我想找到这个程序集中的所有命名空间,所以我可以将它们转换为自动生成的源代码文件模板的“using”(VB中的“Imports”)语句。 理想情况下,我只想将自己限制在顶级命名空间,而不是: using System; using System.Collections; using System.Collections.Generic; 你只会得到: using System; 我注意到System.Type类上有一个Namespace属性,但有没有更好的方法来收集程序集内的命名空间,而不涉及迭代所有类型并剔除重复的命名空间字符串? 大卫,很有责任

Web浏览器控制限制

我在Windows窗体C#项目中使用WebBrowser控件,并想知道您可以同时运行多少个此类应用程序实例的任何限制。 (换句话说,MSFT强制执行除物理机器限制之外的任何限制 – CPU /内存等)

visual basic 6.0的转换工具比较

有没有人使用以下任何一种(或任何其他工具)将您的vb6代码转换为.net语言? Artinsoft的升级伴侣 (转换为c#和vb.net) vbmigration合作伙伴 (转换为vb.net) 他们和你转换的大小项目效果如何? 之后剩下多少工作要做? 你对自己的.net项目感到高兴。 支持是什么样的? 对于像这样的工具的用户,是否有任何支持论坛,供应商似乎都没有提供。 他们收取了什么费用,他们的价格没有公布,而且我听到上述两个例子来自不同来源的价格差别很大

asp.net文本框的丢失焦点方法?

如何为asp.net文本方法编写丢失焦点方法? 请任何人有任何想法写这个,与我分享?

选择具有多个IP时的HTTP请求使用的IP(.NET)

我正在编写一个.NET程序,它将在具有多个IP地址的计算机上运行。 该程序向给定的Web地址发出HTTP请求。 我想选择我使用的IP地址(因此我可以确定哪个IP地址将出现在另一台服务器的日志中)。 建议?

C#中“与…结束”的等价性?

我知道C#有using关键字,但是自动using对象处理。 在Visual Basic 6.0中是否存在With…End With的等价性?

Nullable 的装箱/拆箱行为怎么可能?

我今天早些时候发生的事情让我摸不着头脑。 任何Nullable类型的变量都可以赋值为null 。 例如: int? i = null; 起初我无法看到如果不以某种方式定义从object到Nullable的隐式转换,这将是如何可能的: public static implicit operator Nullable(object box); 但是上面的运算符显然不存在,好像它确实如此,那么以下内容也必须是合法的,至少在编译时(它不是): int? i = new object(); 然后我意识到也许Nullable类型可以定义一个隐式转换到一些永远无法实例化的任意引用类型,如下所示: public abstract class DummyBox { private DummyBox() { } } public struct Nullable where T : struct { public static implicit operator Nullable(DummyBox box) { if (box == null) { return new Nullable(); […]

升级应用程序时安装到相同路径

我有一个应用程序,我正在实现自动更新。 我有一个程序检查的Web服务,如果需要升级它,下载并运行新的安装程序(Visual Studio 2005安装项目),之后程序重新启动。 一切都很好。 但是,如何确保安装程序中的安装路径默认为用户最初安装程序的路径? 例如,如果用户将其从程序文件更改为C:\ SomeFolder,我将如何让安装程序检测到并将其安装路径更改为C:\ SomeFolder而不是程序文件? 或者,如果用户选择将其安装为“当前用户”而不是“所有用户”?

检查文件/文件夹访问权限

我得到一个运行此代码的UnautorizedAccessException : string[] fileList = Directory.GetFiles(strDir, strExt); c:\users\username\appdata发生exception如何检查我是否具有访问权限(列出和读取文件)?