.net

Is it possible to use the toolstrip standard item icons for anything else?

I followed the trail of the ToolstripMenu in designer to the following line: (System.Drawing.Bitmap) new System.ComponentModel.ComponentResourceManager(typeof(FormMain)).GetObject("saveToolStripButton.Image") I can duplicate that and use it my form code as long as the toolstripMenuItem is on the form. Is it possible to access these ic...

What is the correct way to compare char ignoring case?

I'm wondering what the correct way to compare two characters ignoring case that will work for all cultures. Also, is Comparer<char>.Default the best way to test two characters without ignoring case? Does this work for surrogate-pairs? EDIT: Added sample IComparer<char> implementation If this helps anyone this is what I've decided to us...

State is not retaining in checkbox

There is a check box in my webform. whenever i tick it ..and click on back button it will not retain its state ..when i comeback using the next button to the same page. Note: view state is enabled in the control There is no code in the page load event Code below: Protected Sub chkBx_SR_wu_SelectedIndexChanged(ByVal sender As Object...

How to get a Long Date format from DateTime without a weekday

I'm looking for a locale-aware way of acquiring a long date time without the weekday. Just such a beast exist? Below is the code I use to get the long date format including the weekday: DateTime time = ... String formattedDate = time.ToLongDateString(); Edit Examples of what I would like to see: en-us: December 5, 2009 fr-fr: 5 d...

.Net 1.0: Is there a Serializable attribute for the Compact Framework

Going "old school" with a .Net 1.1 Compact Framework app and I'd like to be able to serialize a list of objects to memory -- are there any serialization libraries included in the 1.0 framework? I should add that the System.Runtime.Serialization namespace doesn't exist in the 1.1 Framework (or so my compiler says). ...

Applying selected styles to a tab control after asynchronous postback occurrs

I have been going crazy over a problem with my tab control. It has to do with something messing up during ajax requests in ASP.NET and it's driving me crazy because I think I've gone through at least 50 different possible solutions to try to fix this problem. Let me explain. I have a Tab control (a TabStrip). Its simply a table (genera...

Relative Web service references in .net and silverlight

Is it possible to make these relative? for example: webservice.asmx rather then http://servername/webservice.asmx ...

Better way to check if Path is a File or a Directory ? (C#, .NET)

I am processing a TreeView of directories and files, users can select either a file, or a directory and then do something with it. This requires me to have a method which performs different actions if they have selected a file, or a directory. At the moment I am doing something like this to determine if the path is a file or a directory...

Can I programmatically do a "net use" on a file share?

Within a VB.NET program, I want to read files from a filesystem, then write a compressed version of those files to a remote, secure fileshare, using different credentials. The analogous operation at the cmd prompt is: net use s: \\server\share /user:foo P@ssw0rd copy a+b | compress > s:\foo.bin net use s: /delete Is this possible? ...

.NET - download a web page with multiple authentication

There is a particular secure web page that we are required to download and parse. Its from this parsed data we need to do a host of other things... The so-called 'multiple authentication' part goes like the follows: If you've hosted web sites on IIS and turned on the Integrated Security feature (with anonymous browsing turned off), you'...

.NET - WinForm Textboxes - Focus and SelectedText

Whenever I set focus to a Textbox in WinForms (.NET 3.5) the entire text is selected. Does not matter if I have MultiLine set to true or false. Seems to be the exact reverse of what this user is seeing: http://stackoverflow.com/questions/97459/automatically-select-all-text-on-focus-in-winforms-textbox I have tried to do: private vo...

Is there a good 3rd party Job Scheduling Library for .Net?

I am about to start working on a project where we need to process a large amount of data throughout the day. Basically, as changes happen in our system, we will need to reprocess all units associated with the change. When this happens, we want to give highest priority to the units with a date closest to today, then process this week’s ...

ASP.NET Convert.ToDateTime("Tue, 08 Sep 2009 13:31:00 -0500") is off by an hour

Using the ASP.NET 3.5 framework, Convert.ToDateTime("Tue, 08 Sep 2009 13:31:00 -0500") returns a DateTime object with a time of 14:31. Note that I'm on the East Coast (EST -0500) so I should be seeing 13:31. I'm assuming this has to do with Daylight Saving Time (DST) not being accounted for in Convert.ToDateTime. Is there an elegant way...

How can I invoke a static method on a .NET object over COM interop?

Is it possible to invoke a static method on a .NET Object, via COM interop? I know I could write a wrapper class. What if I don't wanna do that? ...

XmlTextWriter responds with System.InvalidOperationException during creation of second element

Hi, I am having trouble with XMLTextWriter.WriteStartElement throwing an exception: System.InvalidOperationException when trying to write the second element in my XML document. This error comes back as "The Writer is closed". I have not closed it, so I am guessing it has fallen out of scope?? I have created a class to write an XML...

What is this pattern called?

Private someSub() If someBoolean = True Then Exit Sub ' do some great work because someBoolean is False End Sub I know there is a name for this. The idea is to check something and if it isn't what you want then you stop code processing. I thought it was called "escape pattern", but Google isn't confirming that name. ...

Why is my ListBox throwing an exception?

Okay, I was able to create a simple WinForms project that reproduces some strange behavior I found. In the designer, make a Form with a ListBox (named lbx) Anchored Top,Left,Right,Bottom, and a Button (button1). Now, the Form's code is here: using System; using System.Windows.Forms; namespace ListBoxKaboom { public partial class ...

Is there a bitbucket in COM? Something like .NET's System.IO.Stream.Null?

I know about the ADODB.Stream object. But what I really want is a Stream for which calls to Write() are no-ops. Like System.IO.Stream.Null. I think ADODB.Stream is more like a MemoryStream, which accumulates the data in memory. And I cannot create an instance of System.IO.Stream.Null from COM, because it is a static property on t...

Exception logging tools in .Net

I'm looking for a good tool that will give me a detailed analysis of exception in production releases. I know of EurekaLog and I saw once an add for a software with a frog or something similar in it's name, searched it in Google without any results. Does anyone have recomandations ? My main goal of course is to extract the maximum amo...

Why doesn't .NET find the OpenSSL.NET dll?

EDIT (the whole question, it was too unclear) I want to use OpenSSL.NET The OpenSSL.NET install instructions page: INSTALL Make sure you have libeay32.dll and ssleay32.dll in the current working directory of your application or in your PATH. DONE In your .NET project, add a reference to the ManagedOpenSsl.dll assembly. DONE I...