.net

In what thread does the VS Debug Immediate window execute commands?

I have a multi-threaded .Net app in which thread-local storage is used to hold a flag of sorts. I have reason to suspect that the flag is being set incorrectly in one of the threads and would like to use the VS debugger to inspect when and where the flag is being set. Once I have stopped the application at a break point, can I use the i...

How do I intercept a NotImplementedException in a WPF application?

How do I intercept a NotImplementedException in a WPF application? I'll occasionally throw a NotImplementedException while testing my in-progress WPF application: Private Sub ButtonDoSomething_Click(...) Handles ButtonDoSomething.Click Throw New NotImplementedException( _ "ButtonDoSomething_Click() not implemented.") End Su...

HttpWebRequest with https in C#

This piece of code doesn't work; it's logging in into website which is using https protocol. How to solve this problem? The code stops at "GetRequestStream()" anytime anywhere saying that protocol violation exception is unhandled.. string username = "user"; string password = "pass"; HttpWebRequest request = (HttpWebRequest)WebRequest.Cr...

Scan Running .NET App for String Value

I have to debug a massive program, and I was wondering if there is a way to scan the memory footprint of a running .NET application, and find a string property that is set to a certain value? ...

C# Is there a LINQ to HTML, or some other good .Net HTML manipulation API?

Hello all, I have a C# WPF application that needs to consume data that is exposed on a webpage as a HTML table. After getting inspiration from this url I tried using Linq to Xml to parse the Html document, but this only works if the HTML document is extremely well formed (and doesn't have any comments or HTML entities inside it). I h...

Tracking actions in a browser component

Hi Guys, Im a c# developer and I believe that what I want to achieve is going to move out of the realms of some drop in .NET component so I am looking for advise on what I use externally which .NET can inter op with. My requirements are to have an embedded web browser control in a WPF/Winforms applciation BUT I will also need to keep...

How to keep logged instance (httpwebrequest) alive and query another page with it?

Hi, After I've succesfully logged into website using POST variables by httpwebrequest and got response by HttpWebResponse ..How do I query other websites with the "current logged in" instance? Do I save it to some variable?? ...

Disabling ASP.NET EventValidation

We're tired of getting exceptions regarding "Invalid postback or callback argument" in our web app. What scenario(s) causes this error? After talking to users, we've determined that one possible cause of this is when they click something that causes a postback, and then click something else before the initial postback completes. What ...

desktop to windows mobile communication

Hi I want to make a desktop application trigger an event on a Windows Mobile 6 standard device (smartphone). How can I make the smartphone and desktop communicate? Where can I find some code examples of this? I'm using C#... To clarify: It will not be docked with USB. I would like to use WLAN. I want to trigger an event within m...

How to duplicate a SQL Server 2000 table programatically using .NET 2.0?

I want to backup a table saving the copy in the same database with another name. I want to do it programatically using .NET 2.0 (preferably C#). Someone can point me what should I do? ...

DateTimePicker control usage in specific scenario

This question is relating to a specific functionality that a client has requested for an application I am designing. Basically, the client wants the DateTimePicker to prompt a question after the date was selected. This sounds simple, however, I am having difficulties accomplishing this simple task. If I prompt OnCloseUp - Keyboard ...

How would I use LINQ2XML in this scenario?

I have my LINQ2XML query working half way to my goal: var XMLDoc = XDocument.Load("WeatherData.xml"); var maximums = from tempvalue in XMLDoc.Descendants("temperature").Elements("value") where tempvalue.Parent.Attribute("type").Value == "maximum" select (string)tempvalue; var minimums ...

Getting started with WebParts

Where I work the department has it's own intranet site (not sharepoint!) that is separate from the main company's. The main page is a jumble of over 150 different links grouped into about 20 categories. It's a real mess of a page. What I want to do is turn this page into a sitemap. I'll put all the links into a database that the site...

.NET: How to have Escape close a MessageBox.Show()?

Assuming the code: MessageBox.Show(this, "Would you like the differential girdle spring on the up-end of the grammeters?", "Smi-Boloid Stater Slots", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); If the user presses Escape, i want it to close the message box, and the Show() method can return Dialo...

Help needed to convert code from C# to Python.

Can you please convert this code from C# to Python to be run on IronPython? I don’t have any experience with Python. using System; using Baz; namespace ConsoleApplication { class Program { static void Main() { Portal foo = new Portal("Foo"); Agent bar = new Agent("Bar"); foo.Connect("127.0.0.1", 1...

Incremental .NET code coverage tool?

I'm looking for a tool (preferably free) that analyzes incremental code coverage of our C# solution. What I mean by this is that I don't want to know what the total code coverage is for all code or even for a namespace, but only new lines of code or perhaps lines of code that changed since the last checkin. (We use subversion for source...

How do I directly read and write database files in vb2008?

How do I read and write a file using a file format which is readable by a database server, in vb2008? I have very little experience working with databases, and I can't seem to find any tutorials which don't involve some type of server as a middle-man. ...

Adding Plugin Support : Interface or Base class to inherit?

I'm adding plugin support to my .NET application. A base class sounds reasonable to me, so people can inherit it and override certain calls as well can keep the default functionality or can use some internal helper functions. Why would I choose interface instead of a base plugin class to inherit? Could you tell which design I should ch...

How to provide access to helper functions for plugins?

In my .NET application I allow people to add their plugins. However I've got several helper functions which will help them. What's the best way to provide access to these functions for plugins? Shall I just add a new DLL to the project and put all helper methods / classes to there and tell plugin developers to link that DLL? I'm cur...

What's the difference between Assert.AreNotEqual and Assert.AreNotSame?

In C#, what's the difference between Assert.AreNotEqual and Assert.AreNotSame ...