.net-1.1

Print out the keys and Data of a Hashtable in C# .NET 1.1

爷,独闯天下 提交于 2021-02-18 10:37:25
问题 I need debug some old code that uses a Hashtable to store response from various threads. I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable. How can this be done? 回答1: foreach(string key in hashTable.Keys) { Console.WriteLine(String.Format("{0}: {1}", key, hashTable[key])); } 回答2: I like: foreach(DictionaryEntry entry in hashtable) { Console.WriteLine(entry.Key + ":" + entry.Value); } 回答3: public static void PrintKeysAndValues( Hashtable

Print out the keys and Data of a Hashtable in C# .NET 1.1

佐手、 提交于 2021-02-18 10:37:11
问题 I need debug some old code that uses a Hashtable to store response from various threads. I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable. How can this be done? 回答1: foreach(string key in hashTable.Keys) { Console.WriteLine(String.Format("{0}: {1}", key, hashTable[key])); } 回答2: I like: foreach(DictionaryEntry entry in hashtable) { Console.WriteLine(entry.Key + ":" + entry.Value); } 回答3: public static void PrintKeysAndValues( Hashtable

How can I change the mouse cursor image?

谁说胖子不能爱 提交于 2021-02-08 07:36:21
问题 I need to change the cursor image. Whenever the mouse is over my form I need to load my own image from a local path. I am using version 1.1 of the .NET framwork. Here is what I have tried: Cursor = new Cursor(GetType(), Application.StartupPath+ "\\windowfi.cur"); But this throws an exception: Value cannot be null. Parameter name: dataStream 回答1: Cursor class has a constructor that takes in cur file path as a parameter. Use that. Like this: this.Cursor = new Cursor("<your_cur_file_path"); 回答2:

GetProcessesByName() and Windows Server 2003 scheduled task

被刻印的时光 ゝ 提交于 2020-02-25 08:23:42
问题 Does anybody know what user privileges are needed for the following code needs to successfully execute as a scheduled task on Windows Server 2003: System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName) When NOT running as scheduled task i.e. under a logged in user, as long as the user is a member of "Performance Monitor Users", this code will not throw an exception. When running as a scheduled task under the same user account, it fails. The only way I can get

GetProcessesByName() and Windows Server 2003 scheduled task

拈花ヽ惹草 提交于 2020-02-25 08:23:07
问题 Does anybody know what user privileges are needed for the following code needs to successfully execute as a scheduled task on Windows Server 2003: System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName) When NOT running as scheduled task i.e. under a logged in user, as long as the user is a member of "Performance Monitor Users", this code will not throw an exception. When running as a scheduled task under the same user account, it fails. The only way I can get

Determining exact glyph height in specified font

倾然丶 夕夏残阳落幕 提交于 2020-01-21 01:36:26
问题 I have searched a lot and tried much but I can not find the proper solution. I wonder is there any approach for determining exact glyph height in specified font? I mean here when I want to determine the height of DOT glyph I should receive small height but not height with paddings or the font size. I have found the solution for determining exact glyph width here (I have used the second approach) but it does not work for height. UPDATE: I need solution for .NET 1.1 回答1: It's not that hard to

ArrayList Search .net

落爺英雄遲暮 提交于 2020-01-15 05:05:08
问题 Following is the format of the data stored in my arraylist. A-Amsterdam B- Brussels C-Canada so and so forth. I wan to search my array list by passing just the first few characters till '-' So if i have something like AA-Test then i want to pass just 'AA' to check if it exists or not. I know that i can use contains or binarysearch but it does not serve my purpose as they both compare objects. Any suggestions?? thanks 回答1: You can solve this by creating your own IComparer and passing it into

Exclude the Totals Row from sorting a bound DataGridView

痞子三分冷 提交于 2020-01-11 13:55:33
问题 I am showing a Totals Row as last row. I want to exclude that row from sorting when the user clicks on the column header. By using sql union I am adding total column to my result. I am using SQL, C# and DataGridView control. I am not able to expose ColumnHeader_Click event. I am only using TableStyle[0].AllowSorting = false . How can I apply that custom sorting on the control? Thanks 回答1: Thanks TaW, your answer helped me. My needs were a little different, I needed the Total to appear at the

Mocking framework for .Net fx 1.1?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 08:31:49
问题 Anyone have any ideas what I can do? Please reserve commenting about using 1.1 still, it's out of my hands :( 回答1: Rhino Mocks is supposed to be compatible with the framework 1.1, according to their website. It is a really good mocking framework, once you get used to it Have a look here to see what you'll be able to do, and what you won't be able to do: ayende.com/Wiki/(S(lqa0ob552sfbu545c5ss4b55))/Rhino+Mocks+Generics.ashx 回答2: I use both NMock2 and an older version of Typemock Isolator at

Managing multiple .Net-Frameworks on a webserver

孤者浪人 提交于 2020-01-04 05:31:25
问题 So I'm in charge to deploy my project on the productive server where some other ASP.NET-Websites are also set up. The problem now is that I wrote my whole project under .NET 3.5 but on the webserver the current installation is .NET 1.1 as some of the other projects require them (don't ask me why, I can't figure it out either but my PM says so...) and thus I'm not allowed installing 3.5 for now but I'm not at all in the mood of rewriting my project on 1.1. Now; is it possible (and if yes, how)