.net

Installer Project with non-EXE products, and customs steps

I've created an Installer project (via the Installer Wizard project) in Visual Studio 2008. Its easy to install EXE's and DLL's with, but I've got a more complicated deployment process. There's a FireFox extension (.xpi) that I want to deploy. I would like to include it as an output of another project, rather than copy it into the Ins...

Getting data into and out of SQL tables with C#

Getting data into and out of SQL tables with C# I built a C# app that puts data into a SQL table. I am currently using the SqlConnection class in .net. Got started with this article. http://www.codeproject.com/KB/database/sql_in_csharp.aspx I had thought about looking at Linq to SQL but have not done it before and wasn't sure how to g...

Secure TCP .NET Remoting Channel without Authentication

I have a .NET 2.0 remoting application that needs to communicate between machines that may be on different domains or no domain at all. It is using the TCP channel. Everything works fine until I enable encryption, then when connecting I get the error "The server has rejected the client credentials." I have done quite a bit of searching,...

How is dumpbin able to read the export table when it appears at a file offset larger than the file itself?

I'm writing a little PE reader, so I run dumpbin alongside my test application to confirm that the values are being read correctly. Everything it working so far, except for the export table. The file I'm testing with is a DLL. My application reads the file in as a byte array, which gets passed to my PE reader class. The values align wit...

Bare minimum call to WCF service as Http Post platform independent

I created a minuscule WCF service as a proof of concept. I eventually want to have a WCF service exposed very simply over the web for any consumer to call by URL with the ability to post data to some of the methods (non-.Net clients, so it should appear to the public as a simple web service). I use the webHttpBinding, enabled webHttp i...

Non-resizable windows with windowStyle=None

Basically, I want to create a window that looks like the following: However, the window shouldn't be resizable (the one in the screenshot is) but must retain the glass border. The XAML for the window in the screenshot is as follows: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schem...

C# - UpdateResource - To Remove A Resource

I am able to successfully add a resource to a file using UpdateResource and then remove it using: UpdateResource(HANDLE, "TYPE", "NUMER", 1033, IntPtr.Zero, 0); When I add a resource to the file it will add another even though there is an existing resource exactly the same, also I cannot remove any existing resources. When I try to remov...

Why Wait for Asynchronous Web Services Calls

I was going through MSDN documentation on WebServices. Here and here, both these links talk about calling a webservice and wait for the response, which is also a general trend that I have seen while asynch implementation. I don't understand "why do we need to wait for service call to return"? And, if we are waiting why don't make an syn...

.NET: How to watch memory footprint of an individual object

Hi folks: Could I use any library programatically to watch memory of an object? Thanks. ...

Interface issue

i added a property 'WrmVersion' in interface IResourcePolicy but i am not getting those thing in the implementation side means here it should come in the List view data. means SubItems.Add(((IResourcePolicy)Data).WrmVersion is not getting This is the interface public interface IResourcePolicy { DataVersion WrmVersion ...

Call public function in another application

If I have a Windows Application WinApp that has a public function pubFun, how can I call it from a different windows application --> WinApp.pubFun() ? Thanks in advance ...

How Bad is this Code?

Ok, I am an amateur programmer and just wrote this. It gets the job done, but I am wondering how bad it is and what kind of improvements could be made. [Please note that this is a Chalk extension for Graffiti CMS.] public string PostsAsSlides(PostCollection posts, int PostsPerSlide) { StringBuilder sb = new StringBuilder();...

SOAP Message Expiration

How to use time-stamp in SOAP Header to implement Message Expiration? Note: Using .NET 2.0, so ASMX Services and NO WCF. ...

C# OnPaint mousemove high cpu usage

I have written a custom control that renders some graphics. The graphics itself is fairly expensive to render but once rendered it rarely changes. The problem I have is that if you move the mouse really fast over the graphics surface it keeps calling the control's overridden Paint method which then incurs a high CPU penalty: private voi...

MemoryMappedFile.CreateFromFile always throws UnauthorizedAccessException

I realize .NET 4.0 is in Beta, but I'm hoping someone has a resolution for this. I'm trying to create a memory mapped file from a DLL: FileStream file = File.OpenRead("C:\mydll.dll"); using (MemoryMappedFile mappedFile = MemoryMappedFile.CreateFromFile(file, "PEIMAGE", 1024 * 1024, MemoryMappedFileAccess.ReadExecute)) { using (M...

Deployment projects for multiple sites

I have 7 sites that should be deployed to my DEV server, then to my QA server and in the end to the PROD servers. Currently everything is done manually, but it's a chore. Today I looked at the Deployment solutions, but it seems it's one deployment solution per site. Is there a way to have multiple sites deployed with one action? ...

How to pass value from a control on Silverlight (mainPage.xaml) to control on asp.net(default.aspx ) page

Hi, I have a scenario where I want to pass data from controls on the silverlight page to controls on the asp.net page.I tried to search on it and found example of javascript but that is not helpful for me. I read about the WCF also but since I am new this world of silverlight I not able to produce result from it. So please if anyone have...

Hello im very new to Wpf and also to progamming. I need to do project on barcode generation.

I found lot of Barcode generation codeprojects in C#. But could not find 1 in VB.Net. Please help me on this. ...

Why would be the drawback of forcing my domain objects to implement INotifyPropertyChanged ?

I am thinking of making all my entities in my domain model implement INotifyPropertyChanged . My main reason behind this would be: If some entity gets changed in the domain the presentation layer would immediately know about it and change accordingly (I am trying to implement the MVPVM pattern and the presentation objects are not the sa...

SQL Server CE "module could not be found" Crash

We are getting following error message in one Windows XP - X86 Exception Source: System.Data.SqlServerCe Exception Type: System.DllNotFoundException Exception Message: Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) Exception Target Site: DllAddRef SQL S...