.net

How to find about structure of bitmap and JPEG files?

I'm trying to write a very simple image processing program for fun and practice. I was using System.Drawing. ... .Bitmap class to handle images and edit their data. but now I want to write my own class of Bitmap object implementation and want to know how bmp files (and other common bitmap formats) and their meta-data (indexing, color sys...

Strange problem with DataReader?

I am facing a strange issue with DataReader. I am using OdbcClient with a legacy rdbms system. I am sending follwing command to the database. select Col1, Col2, Col3 from Table1 where Col2 = 'Val1'; However in certain cases when I iterate it through DataReader as shown below. IDataReader reader = cmd.ExecuteReader(); while(reader.R...

After which event should I perform an action after editing a cell in a DataGridView?

I have a WinForms DataGridView control on a form. There are two fields in this DataGridControl: Email Address Resolved Email Address (calculated based on the input in Email Address) After the user inputs or changes a value in Email Address, I want the value in Resolved Email Address to update based on a separate method. What event ...

Leaving no/less traces

Hi, I have a asp.net/c# web app. When do user leave a certain page, I would like to delete 1 particular temp file on the client machine, in the temp file folder. Can I do this at all? Can I do this server side or client side? Thanks. ...

Sending a file over web service from java to .net

Hello, I have built .NET 1.1 Web Service which should accept files and save them. Here is the code of the webmethod: [WebMethod] public bool SaveDocument(Byte[] docbinaryarray, string docname) { string dirPath = @"C:\Temp\WSTEST\"; if(!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } strin...

Can anyone explain this strange behaviour?

Hi, guys. Here is the example with comments: class Program { // first version of structure public struct D1 { public double d; public int f; } // during some changes in code then we got D2 from D1 // Field f type became double while it was int before public struct D2 { public dou...

Looking for documentation for writing database-related unit tests in .Net.

Hi, I have heard that MbUnit comes with pretty nice test decorators which allow writing db-related tests with ease. I am struggling to find good documentation with samples. Also, can the same thing be achieved with the latest Micosoft's Test package? Many thanks. ...

How can I show Form in process1 from Form in process2 ?

Hi I'm trying to show hidden form in process1 from another one was called by : Process.Start(@"F:\MyOtherFormPath\MyOtherForm.exe",this.Handle.ToInt32()); As you can see i passed the handle number of the hidden form ,which i'm calling the "MyOtherForm" from, and i used this number to get a handle and show the hidden form from my "MyOt...

Listbox items not selectable

In silverlight, I'm creating a listbox at runtime. The listbox displays on the page okay but the items aren't selectable - I don't understand why? Am I doing something wrong? Here's my code: C# public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); ListBox lb = GetListbox(); ...

Looking for .NET Math method that will zero a negative integer

Similar in concept to Math.Abs() - I'm looking for a function that when given a positive integer will return the same integer. If given a negative, will return zero. So: f(3) = 3 f(0) = 0 f(-3) = 0 Yes, this is simple enough to write on my own but I'm wondering if the .NET Math class already has this built in or if the same can be a...

Getting details of a DLL in C#/.NET

Is there a way to get the values of various properties of a (both .NET and non-.NET) DLL via C#? I'd like to read the 'Product name' field in particular. ...

Regular expressions .net

I have the following function that I am using to remove the characters \04 and nulls from my xmlString but I can't find what do I need to change to avoid removing the \ from my ending tags. This is what I get when I run this function <ARR>20080625<ARR><DEP>20110606<DEP><PCIID>626783<PCIID><NOPAX>1<NOPAX><TG><TG><HASPREV>FALSE<HASPREV><H...

Best way to mock WCF Client proxy

Are there any ways to mock a WCF client proxy using Rhino mocks framework so I have access to the Channel property? I am trying to unit test Proxy.Close() method but as the proxy is constructed using the abstract base class ClientBase<T> which has the ICommunicationObject interface, my unit test is failing as the internal infrastructure ...

WPF: change binding properties for multiple controls

I'd like that all the Text bindings for the TextBoxes in my UserControl to have UpdateSourceTrigger=PropertyChanged, and ValidatesOnDataErrors=True How to do it ? I can think of a solution: use another class for bindings (a class inheriting Binding) but maybe there is another solution, maybe using a style or template ? ...

Are there any hierarchical, multi select controls that use check boxes in ASP.NET

I need to be able to select multiple options on a web form, but those options are hierarchical. For example: Option 1 Option 1 a Option 1 b Option 2 The user should be able to select Option 1, or Option 1a, etc. Selecting Option 1 a should automatically select Option 1. Any controls/solutions out there that fit the bill? (I'...

Wunderground and UTC Offset

I am consuming the international weather forecasts via Wunderground's XML API: http://wiki.wunderground.com/index.php/API_-_XML Looking at an output for Kabul, Afghanistan for instance: http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=OAKB I notice that there is no UTC offset. The closest that I can see is this:...

Example on System.Speech.Synthesis.TtsEngine?

Do you know of any (simple) examples on the namespace System.Speech.Synthesis.TtsEngine? I'd like to use a TTS engine that allows me to control the pitch, the rate and the volume of the output voice. It looks like the namespace mentioned above allows me to do that, but I couldn't find a single example. I've not fully understood if, in o...

SSL certificate pre-fetch .NET

I am writing a utility that would allow me to monitor the health of our websites. This consists of a series of validation tasks that I can run against a web application. One of the tests is to anticipate the expiration of a particular SSL certificate. I am looking for a way to pre-fetch the SSL certificate installed on a web site usin...

Windows Service WebBrowser DocumentCompleted Bug

I've been building a Windows Service to create a WebBrowser object to navigate, login, and download a site's HTML. However, I recently discovered this bug which prevents the DocumentCompleted event from firing if the WebBrowser is not visible: http://support.microsoft.com/kb/259935 I've got to assume this is because the Windows Service...

Garbage collection of working environment?

Could anyone elaborate what work you are doing in garbage collection in daily corporate work? How much your considering garbage collection in your SDLC? ...