.net

Access internal field [WebClient]

I have a WebClient instance that receives data from a remote website. I referenced a DownloadProgressChanged event handler and I am trying to access InnerBuffer, which is an internal field in the DownloadBitsState nested class (set as private) in WebClient. I am using the following code right in the DownloadProgressChanged event handler...

Get Bitmap Handle (IntPtr) from byte[] using C# .net

I have a byte[]. It contains data of an image (jpeg or bitmap) with all the header info. How can I create a bitmap from that byte[] , and obtain a handle to that bitmap? The important point is, I need to get a handle to that bitmap. The handle I need to get is of type IntPtr. ...

How should I read in data from a text file using .NET, with a TWIST!

Hi folks, Yes, this might sound like a newbie question but there's a TWIST! (And i've done an SO search already...) I'm trying to read in multiple files, one at a time ... while each file is possibly getting new data APPENDED to the end of it. I always know the last character position i was last at. So when I get to a file, I'm think...

jQuery getJson() not working with in ASP.NET MVC

I want to use jQuery to make a simple call to my MVC controller. I was able to debug the server side, meaning the controller picked up the ajax call and return the information requested. But the client side is never updated after server side returns. When I use FireBug to debug the script, the client side is stuck on event.isImmediatePro...

how to avoid [Content_Types].xml in .net's ZipPackage class

I wish to know if there is any way to avoid to have a [Content_Types].xml file inside the zip file while using .net's ZipPackage class. ...

Modal Popup Extender Not Working

I've looked at every problem associated with the Modal Popup Extender to no avail. I'm using Visual Studio 2008 with the latest Ajax Toolkit. And I've tested it on all the major browsers and it doesn't work on any. I've poured over numerous examples and they all look like mine but it still doesn't work. As of right now, everything is...

error calling function ,[A call to PInvoke function unbalanced the stack]

hello all i have following code , once i run my application i get this error anyone know how i fix this error? ERROR: A call to PInvoke function 'testcamera!EDSDKLib.EDSDK::EdsDownloadEvfImage' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that th...

Zip file using C#

Hi, I want to zip one "CSV" file in to Zip file using C#.Net. Below i have written some code for create Zip file , using this code i am able to create zip file but after creating "Data1.zip" file extract manually means extracted file extension should be ".csv" but it is not coming. FileStream sourceFile = File.OpenRead(@"C:\Use...

Use HttpListener to get format of incoming data in .net

I am writing a server-side program. I created a HttpListener to listen for incoming requests. How can I find out what kind of data is being sent in? E.g. is it a text, image, pdf, word? Pls correct my code below if it is wrong. I'm really new to this and my understanding of the HTTP concepts may be wrong. Thanks. main() { HttpListener ...

Log all exceptions in .NET app using log4net

Hi, Is there any easy way to auto write all the unhandled exception in my application to a log file? I`m using log4net as my logging solution. My application hosted as a windows service. Thanks. ...

Difference between modifying a variable and a property

There is probably a quite logical explanation to this, but I have a question. Let's say I have a variable of type Rectangle called _rect. I can now say _rect.X = 50; without any problems. Now I have a class with a property called Rect that exposes the internal variable _rect. Then, if I try to write Rect.X = 50; I get the following c...

.NET application using too much ram

I'm working on a .net application with VS in C#. I use a bunch of DataGridView's, and when the application uses about 8 of them with about 6 columns and 2000 rows each, the memory used, according to the task manager is about 1.5g. Is that how is supposed to be or could I be doing something wrong? ...

OleDB + Jet: Syntax Error in Join Operation

I've built a complex query for my access database and in access it works like a charm. But when I try to run the same query in my program via OleDB I get the exception "Syntax Error in Join Operation". No further info. SELECT MainTable.Main_dbID, D0.Kvp_Value AS ["Value"] FROM (MainTable INNER JOIN ( SELECT Main_dbID, Kvp_Va...

Modeling a complex Ads application

Greetings, I'm looking for some more experienced insights into my current problem; a short description: The setup and a simplified model. The goal of the web application is to provide a platform for posting, searching and reacting on ads. The ads themselves fall into roughly 3 large categories: Real estate Cars Various (basically a...

Looking for an ebook about Code Review specifically for .net applications?

Hi all. I'm looking for an ebook about Code Review specifically for .net applications. Any Suggestions? ...

Open folder which contains comma in its path

Hi I need to open folder through windows explorer using C#. It is working fine untill there is comma in folder path. Here is an example: System.Diagnostics.Process.Start("explorer.exe", "C:\\folder\\another-folder\\123,456"); The error is: The path '456' does not exist or it is not a directory. Any solution please :) ...

How can I disable the start menu in Windows Mobile 6.1

Hi, how can I disable the start menu! Or completely shut down the entire "explorer" in Windows Windows Mobile 6.1, so that users can not go out of my program. I have try http://pastebin.com/yz6WN6xa , but then Windows Mobile 6.1 hang. ...

How to intercept the TAB key press to prevent standard focus change in C#

Normally when pressing the TAB key you change the focus to the next control in the given tab order. I would like to prevent that and have the TAB key do something else. In my case I'd like to change focus from a combobox to a completely different control. I can't do this by setting the tab order. I need to do this programatically. Any id...

Modify Assembly Version and References (.NET)

I have an application exe plus 3 referenced assemblies in a folder. Compiled in VS2010, CLR 4.0. I'd like to modify the version of all 4 assemblies to match (1.0.0.0) and also modify the reference section in each of those assemblies to match the new version number. Is that possible after the application was already build outside the ID...

make serverside strings safe for use in clientside scripts

i need to show the server exception in client browser, but it seems there are some illegal characters inside the exp.Message which makes the client script to raise "unterminated string literal" error. any idea to make strings such as exp.Message safe for client scripts? catch (Exception exp) { string __script = string.Form...