.net-2.0

Button image too far from top of button; too close to bottom of button

痴心易碎 提交于 2019-12-23 10:39:25
问题 I'm working on a Windows Form in VB.NET 2005 and I would like to have some buttons with images (I'm talking about the plain, vanilla System.Windows.Forms.Button). I have everything set up the way I want it but the images are displaying too low on the button, such that the bottom of the icon is almost right on the bottom of the button and there is a lot of space above the image. Here is a screenshot: Button Screenshot http://www.freeimagehosting.net/uploads/b28a5c63b8.jpg See how the corner of

HtmlAgilityPack XPath case ignoring

余生颓废 提交于 2019-12-23 09:18:19
问题 When I use SelectSingleNode("//meta[@name='keywords']") it doesn't work, but when I use the same case that used in original document it works good: SelectSingleNode("//meta[@name='Keywords']") So the question is how can I set case ignoring? 回答1: If you need a more comprehensive solution, you can write an extension function for the XPath processor which will perform a case insensitive comparison. It is quite a bit of code, but you only write it once. After implementing the extension you can

How can I query if a user of one domain is a member of a group in another AD domain?

谁都会走 提交于 2019-12-23 09:16:29
问题 I have a series of applications that all use the same C#, .Net 2.0 code that I've created to check and see if a user is a member of an Active Directory group. I haven't had any trouble with my code until recently, when I added a user from another, trusted AD domain to one of my AD groups. My question is how can I check to see if a user is a member of an Active Directory group, regardless of their domain. In other words, they may or may not be in the same domain as my group. Below is the code

In C#, How can I serialize Queue<>? (.Net 2.0)

十年热恋 提交于 2019-12-23 07:58:35
问题 At the XmlSerializer constructor line the below causes an InvalidOperationException which also complains about not having a default accesor implemented for the generic type. Queue<MyData> myDataQueue = new Queue<MyData>(); // Populate the queue here XmlSerializer mySerializer = new XmlSerializer(myDataQueue.GetType()); StreamWriter myWriter = new StreamWriter("myData.xml"); mySerializer.Serialize(myWriter, myDataQueue); myWriter.Close(); 回答1: It would be easier (and more appropriate IMO) to

Convert XmlNodeList to XmlNode[]

别说谁变了你拦得住时间么 提交于 2019-12-23 07:27:47
问题 I have a external library that requires a "XmlNode[]" instead of XmlNodeList. Is there a direct way to do this without iterating over and transferring each node? I dont want to do this: XmlNode[] exportNodes = XmlNode[myNodeList.Count]; int i = 0; foreach(XmlNode someNode in myNodeList) { exportNodes[i++] = someNode; } I am doing this in .NET 2.0 so I need a solution without linq. 回答1: Try this (VS2008 and target framework == 2.0): static void Main(string[] args) { XmlDocument xmldoc = new

Datagridview, find duplicate rows and update existing data [duplicate]

本秂侑毒 提交于 2019-12-23 05:13:35
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: Datagridview, Only show unique values were Duplicate Cell Values C# 2005 I want to know how to find duplicate rows in a datagridview and if exist only update the data.. i need the code to do that I'm working in C# and .NET framework 2.0 VS2005. I'm not using a database is from query from Active Directory and the values continue repeating. can someone helpme with this...Thanks 回答1: You'd need to loop through

Call method on UI thread from background in .net 2.0

我的未来我决定 提交于 2019-12-23 04:53:19
问题 I am using MonoDevelop (.net 2.0) to develop a iOS and Android app. I use BeginGetResponse and EndGetResponse to asynchronously do a webrequest in a background thread. IAsyncResult result = request.BeginGetResponse(new AsyncCallback(onLogin), state); However, the callback onLogin does seem to still be running on a background thread, no allowing me to interact with the UI. How do I solve this? Can see that there are Android and iOS specific solutions but want a cross-platform solution. Edit:

How to get short “domain name” from dns domain name?

℡╲_俬逩灬. 提交于 2019-12-23 01:45:28
问题 Forgive me if my understanding of this topic has some shortcomings, I only know what I know about domains and active directory because of what I've picked up from working with them. There are two different "versions" of a domain name. The first is what I call the DNS domain name which would be like company.int (for the user max@company.int) and the second would be like prefixname (for the user prefixname\max) and they would both refer to the same thing. My question is, given "company.int",

Printing with the System.WIndows.Forms.WebBrowser control

廉价感情. 提交于 2019-12-22 18:43:30
问题 I'm using th WebBrowser control in the .net 2.0 framework. Is it possible to change the printing behavior so it always prints to the default printer, without showing any dialog to the user? This is for a kiosk so there will always be a printer directly connected to the Kiosk, and printing should be seemless to the user. 回答1: Get the default PrinterName using the method shown here http://msdn.microsoft.com/en-us/library/system.drawing.printing.printersettings.isdefaultprinter.aspx and then

How to use reflection to unit-test an internal (Friend in VB) class within an assembly, when the InternalsVisibleToAttribute is not an option?

半城伤御伤魂 提交于 2019-12-22 18:40:10
问题 I have a solution with two projects within: Company.Project.vbproj Company.Project.Tests.vbproj Within the Company.Project.vbproj assembly, I have a class FriendClass.vb which scope is Friend (internal in C#) . Now I wish to test this FriendClass.vb from within the Company.Project.Tests.vbproj assembly. I know about the InternalsVisibleToAttribute, but that is not an option in Visual Basic .NET 2.0, as it is only available with C#, in .NET 2.0 (see here). I would like to create myself a proxy