.net

Get the char on Control.KeyDown?

Hi When handling Control.OnKeyPress event, there is a KeyPressEventArgs that contains a KeyChar. For usability reasons I need exactly the same KeyChar but when handling OnKeyDown event. The KeyEventArgs does not contains any char related data. I mean, if press the A key with or without Shift its not affecting the KeyCode, KeyData or K...

Collecting Application Metrics in Java (optionally .Net)

I want to be able to expose various time and count based metrics dynamically from my applications. Perf4j works out pretty well for the time ones but does not allow for count in a straightforward way that I'm aware of. for instance I can do StopWatch dbWriteTime = new Log4JStopWatch("ServiceName:DBWrite"); dbWriteTime.start(); ... exec...

how to run the exe file in internet explorer by using the .net application

I have the exe file of micromedia flash player. I am able to run this file from the .net application by using the following code private void button1_Click(object sender, EventArgs e) { System.Diagnostics.Process.Start("peopledisplay.exe"); //System.Diagnostics.Process.Start("iexplorer.exe", "peopledispla...

Security and API implementation - REST

Hi folks, I'm implementing an API using Django. One 1 service should be able to access 1 API url. I am wondering if there are any popular security practices that go beyond using username/password and SSL? Is using sequential signature generation a popular practice? ...

What is a current analog of COM technology?

COM technology seems a little outdated already, though still in use. But what approach is recommended now for implementing the same kind of interoperability when building a .NET app, specifically, in WPF? I.e. what is a modern replacement of a COM object? ...

NPOI HSSF vs SS namespace

I'm trying to use the NPOI library in a winforms app. I have referenced the latest NPOI dll in my project and tried to reproduce the examples gave by NPOI and found on SO: HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.CreateSheet("Sheet1"); HSSFRow headerRow = sheet.CreateRow(0); But th...

How to generate unhandled exceptions in ASP.NET Web App?

I put some global error handling in place, but am having problems testing it by causing unhandled exceptions. Here's all I can think of at the moment. Please feel free to add to this list with more ways to trip unhanndled exceptions. 1) Dangerous form data - Entering characters such as < and > in a text box and trying to submit 2) ...

Pinvoke - Location of the Win32 DLL

I use PInvoke on a win32 DLL and i've currently placed it in my System32 folder. Is there an alternative to this? What if my app needs to be deployed somewhere where i dont have access to system folders? ...

.NET CF Windows Forms - 3 state push button

Hello How to create a 3 state push button that behaves like check box but looks like normal button? Regards ...

Trying to stop using asp concepts in asp.net...

Hello, I get the feeling I am still using asp type scripting techniques in the script below instead of proper asp.net scripting... If this is true, how do I do the below the proper .net way? <%@ Page Language="VB" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Tex...

CA2202, how to solve this case

Can anybody tell me how to remove all CA2202 warnings from the following code? public static byte[] Encrypt(string data, byte[] key, byte[] iv) { using(MemoryStream memoryStream = new MemoryStream()) { using (DESCryptoServiceProvider cryptograph = new DESCryptoServiceProvider()) { using (CryptoSt...

Visual Studio: Simultaneously develop WCF client and server

I need to develop a WCF server (basically a web service which will eventually run in IIS) and a client application that accesses the service. I have both the client and the server project in the same Visual Studio (2008) solution. What's the recommended way to connect the client to the server during development? Two possible solutions ...

What could be causing a deadlock or otherwise causing this concurrency test to inconsistently fail?

I've been fiddling around with CHESS, which seems like an incredibly useful tool. However, ironically, I seem to be dealing with a Heisenbug in one of my test methods. The results reported by CHESS when I run this test are unpredictable: Sometimes the test will pass Sometimes the test will fail, with no further description (simply: "Te...

Output text with hyperlinks

If you have text coming from a database such as: "New Apple TV Offers 8 GB of Internal Storage, 256 MB RAM http://t.co/fQ7rquF" Is there a helper method that takes that text and wraps the web address as a anchor tag? ...

Rename an element using XPathNavigator

I have an XPathNavigator object pointing to an XML element. I want to rename the element to another name (and also rename the associated end element). Can this be done using the XPathNavigator? (I have a work-around, which is to Delete the element and re-insert it under a different name, but this may cause a performance issue, because...

How could I represent a series of events like google calendar?

I need to be able to plot events on a vertical timeline and I like the way Google Calendar achieves this: Currently I'm displaying the information with a ListView component, but this two practical drawbacks: It's far from clear when there's a gap Or, conversely, when there's an overlap Both problems stem from the lack of represent...

MSIL Memory Leaks

Hi All We are using a custom RuntimeDataBuilder class that dynamically constructs a .NET type in-memory using Reflection.Emit to create simple property getters/setters for the information that we receive from a generic WCF DataService. The service exposes a "DataSet like" structure consisting out of 1..m DataTableDefinitions each conta...

Styling the Validation Error on WPF DataGridCell

I'm trying to change the way a DataGridCell appears when it has error content. By default, it has a white background and a red border when it encounters an error. However, it seems that my attempts to set the Validation.ErrorTemplate of this class are being ignored, as are my Triggers on the Validation.HasError property. All of the co...

What are the pitfalls of using .NET RIA Services in Silverlight?

Silverlight can use WCF, Web Services, REST based services, .NET RIA Services, but it seems like Silverlight and .NET RIA Services are preferred most. I want to know if there are any common issues [which can be a show stopper if one goes ahead with this combo] that you have seen in practical implementation of SL with .NET RIA Services. ...

.Net framework version used

I have a third party program installed and I want to find out what version of the .Net framework it is using. How do I figure that out? ...