Access VerticalScroll property of Panel in the Compact Framework

In the standard version of .NET, you can access the VerticalScroll property of Panel controls to view or modify properties such as SmallChange . However, this is not exposed in the .NET Compact Framework. This MSDN article shows that a standard ScrollBar control can be accessed in the Compact Framework, but not the scrollbar on the Panel control with AutoScroll enabled. How do you set the Sm

在Compact Framework中访问Panel的VerticalScroll属性

在.NET的标准版本中,可以访问Panel控件的VerticalScroll属性以查看或修改诸如SmallChange属性。 但是,这并未在.NET Compact Framework中公开。 此MSDN文章显示标准ScrollBar控件可以在Compact Framework中访问,但不能在启用了AutoScroll的Panel控件上使用滚动条。 如何在Compact Framework的Panel控件中设置滚动条的SmallChange和其他属性? 如果需要(或可能),我很乐意从Panel派生类或修改注册表设置。

Set LastWriteTime in the Compact Framework

I need to change the LastWriteTime property in a smart device project (Windows Mobile 6 Professional), so I'm using the Compact Framework. The File class has the support to get the last wirte time ( File.GetLastWriteTime ), but the method File.SetLastWriteTime is not supported. I tried using FileInfo class, and its LastWriteTime property, but it is read only for the Compact Framework. H

在精简框架中设置LastWriteTime

我需要更改智能设备项目(Windows Mobile 6 Professional)中的LastWriteTime属性,所以我使用Compact Framework。 File类支持获取最后一个wirte时间( File.GetLastWriteTime ),但不支持File.SetLastWriteTime方法。 我尝试使用FileInfo类和它的LastWriteTime属性,但它只读Compact Framework。 我能怎么做? 在紧凑框架上,许多功能都不受支持。 你将不得不p /调用这个Windows API函数。 SetFileTime 尝试这个

Convert array of strings to List<string>

I've seen examples of this done using .ToList() on array types, this seems to be available only in .Net 3.5+. I'm working with .NET Framework 2.0 on an ASP.NET project that can't be upgraded at this time, so I was wondering: is there another solution? One that is more elegant than looping through the array and adding each element to this List (which is no problem; I'm just wonde

将字符串数组转换为List <string>

我已经在数组类型中看到了使用.ToList()完成的示例,这似乎只能在.Net 3.5+中使用。 我正在.NET Framework 2.0上处理目前无法升级的ASP.NET项目,所以我想知道:还有其他解决方案吗? 比循环数组并添加每个元素到这个List更优雅(这是没有问题的;我只是想知道是否有更好的解决方案用于学习目的)? string[] arr = { "Alpha", "Beta", "Gamma" }; List<string> openItems = new List<string>(); foreach (string

Get resource without reading it completely into memory

I have an application on the Compact Framework that has some large embedded resources (some of them are several megabytes). I am calling assembly.GetManifestResourceStream(...) which returns a Stream object. However, I noticed that on some devices this call not only takes quite a while but causes the device to run out of available memory. Eventually I used reflector to look at the code for thi

获取资源时不会将其完全读入内存

我有一个Compact Framework上的应用程序,它有一些大的嵌入式资源(其中一些是几兆字节)。 我在调用assembly.GetManifestResourceStream(...) ,它返回一个Stream对象。 但是,我注意到,在某些设备上,这种调用不仅需要很长时间,而且会导致设备耗尽可用内存。 最后,我使用了反射器来查看紧凑框架上此方法的代码,并使用内部方法获取资源数据的byte[] 。 然后它返回包装在MemoryStream这些数据。 有没有什么办法可以在

How to implement single instance per machine application?

I have to restrict my .net 4 WPF application so that it can be run only once per machine. Note that I said per machine, not per session. I implemented single instance applications using a simple mutex until now, but unfortunately such a mutex is per session. Is there a way to create a machine wide mutex or is there any other solution to implement a single instance per machine application?

如何实现每台机器应用程序的单个实例?

我必须限制我的.net 4 WPF应用程序,以便每台机器只能运行一次。 请注意,我说每台机器,而不是每个会话。 我直到现在都使用一个简单的互斥体实现了单实例应用程序,但不幸的是,这样的互斥体是每个会话。 有没有办法创建一台机器宽互斥或有没有其他解决方案来实现每台机器应用程序的单个实例? 我会用一个全局的Mutex对象来完成这个工作,这个对象必须在你的应用程序中保存下来。 MutexSecurity oMutexSecurity; //Set

Launch single console application

Possible duplicate: Run single instance of an application using Mutex I am using VS 2008 in C# on a console application. Not sure if there is any class available (process?) to limit only single console application running at a time. There is no such class, but you can use System.Threading.Mutex to build one. Mutex is a synchronization primitive that can also be used for interprocess synchr

启动单个控制台应用程序

可能的重复:使用Mutex运行应用程序的单个实例 我在控制台应用程序中使用C#中的VS 2008。 不确定是否有任何类可用(进程?)来限制一次只运行一个控制台应用程序。 没有这样的类,但可以使用System.Threading.Mutex来构建一个。 互斥是一种同步原语,也可用于进程间同步。 请参阅示例:如何确保只有一个应用程序的实例可以运行? 我迅速将它打了一巴掌,但它确实显示了第二个控制台,然后隐藏它。 不知道是否有阻止

Singleton by Jon Skeet clarification

public sealed class Singleton { Singleton() {} public static Singleton Instance { get { return Nested.instance; } } class Nested { // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit static Nested() {} internal static readonly Singleton instance = new Singleton();

Jon Skeet澄清了Singleton

public sealed class Singleton { Singleton() {} public static Singleton Instance { get { return Nested.instance; } } class Nested { // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit static Nested() {} internal static readonly Singleton instance = new Singleton();

Unit Testing C Code

I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed refactoring) as well as new code added to the system. Is there any way to make unit testing plain

单元测试C代码

我在今年夏天用C语言写了一个嵌入式系统。这是一个现有的项目,我工作的公司已经接手了。 我已经习惯于使用JUnit编写Java单元测试,但是对于为现有代码编写单元测试(这需要重构)以及添加到系统中的新代码的最佳方式感到茫然。 有没有什么办法让单元测试纯C代码就像使用JUnit单元测试Java代码一样简单? 任何专门针对嵌入式开发(交叉编译到arm-linux平台)的见解都将不胜感激。 C中的一个单元测试框架是Check; C语言中

Integration of automated testing in hudson using selenium framework

I'm new to web development and web testing. And I want to use Hudson in my continous integration and for my automated testing using selenium. How can I integrate the selenium in hudson, so that everytime I build using hudson, it will automatically execute the automated testing in selenium? What application should I install? By the way I'm using ubuntu as my OS. I'm building my w

使用硒框架在哈德森集成自动化测试

我是网络开发和网络测试的新手。 我希望在持续集成中使用Hudson,并使用硒进行自动化测试。 我如何将硒纳入哈德森,以便每次使用哈德森构建时,它都会自动执行硒中的自动化测试? 我应该安装什么应用程序? 顺便说一句,我使用Ubuntu作为我的操作系统。 我正在使用asp.net和C#构建我的webapp。 请指教。 谢谢。 你会像进行正常的单元测试那样调用测试。 假设您正在创建要使用NUnit运行的测试,那么您需要确保已安

How can I get the application's path in a .NET console application?

How do I find the application's path in a console application? In Windows Forms, I can use Application.StartupPath to find the current path, but this doesn't seem to be available in a console application. System.Reflection.Assembly.GetExecutingAssembly() . Location 1 Combine that with System.IO.Path.GetDirectoryName if all you want is the directory. 1As per Mr.Mindor's commen

我如何在.NET控制台应用程序中获取应用程序的路径?

如何在控制台应用程序中找到应用程序的路径? 在Windows窗体中,我可以使用Application.StartupPath来查找当前路径,但这似乎并未在控制台应用程序中可用。 System.Reflection.Assembly.GetExecutingAssembly() 。 Location 1 如果你想要的只是目录,将它与System.IO.Path.GetDirectoryName结合起来。 1按照Mindor先生的评论: System.Reflection.Assembly.GetExecutingAssembly().Location返回执行程序集当前所在的S