.net

Visually remove/disable close button from title bar .NET

I have been asked to remove or disable the close button from our VB .NET 2005 MDI application. There are no native properties on a form that allow you to grey out the close button so the user cannot close it, and I do not remember seeing anything in the form class that will allow me to do this. Is there perhaps an API call or some magi...

Auto-scrolling text box uses more memory than expected (C#, .NET v3.5)

I have an application that logs messages to the screen using a TextBox. The update function uses some Win32 functions to ensure that the box automatically scrolls to the end unless the user is viewing another line. Here is the update function: private bool logToScreen = true; // Constants for extern calls to various scrollbar functions...

Error connecting to secure web service!

I am consistently receiving the following error when trying to create a Web Reference in Visual Studio 2008 to a 3rd party web service. 'Received an unexpected EOF or 0 bytes from the transport stream' I get the same error too if I try to generate a proxy class vith the wsdl.exe tool. I can confirm the web service is operating as it ...

Hooking into DirectX application

Hey there :) I'm currently trying to display some information (as an overlay) to the user inside a DirectX-based game, much like the frame count which Fraps displayed, but I have no clue where to start. I don't expect a full solution to my problem, just a few hints where I can start and where to get more information about the topic ;) T...

C# Outlook 2007 add-in: Recursive parsing of mail items.

Hi all, I'm writing an add-in for Outlook to parse all mails within a folder by clicking on a custom context menu button. I've got the button hooked up, but when trying to use the foreach loop within the folder to check the mail items it only seems to check the first one. I grab the folder details here: void Application_FolderContextM...

Is there a standard way for .NET Winforms apps to auto-upgrade?

If you have a Winforms app that is installed on a large number of machines, is there a standard way of implementing an automatic upgrade function? e.g. Each time it is started, it checks a web site or web service and if there is a new version available, it downloads and installs it? I could figure out how to roll my own version of this...

How to identify duplicate assemblies?

While l was looking over some questions about MEF, I stumbled onto this particular answer to a question. It made me wonder about such a bit since I've never had to attempt such but can see it being very valid in the scenario of that question. Scenario: If you have a directory of various .Net Assemblies all named different, how would yo...

What is preventing my .NET 2.0 application from running on a 64-bit platform?

I have a .NET 2.0 application that won't run on a 64-bit OS (the customer tried both Server 2003 and Windows 7). The error message is: The application failed to initialize properly (0xc0000135). Googling this message returns little helpful information (one link I found just said if you get this message it's because they don't suppo...

If I know the font and the character, how can I programatically find the Unicode equivalent?

We have XML content that uses Wingdings to display ticks and possibly other characters. Our web content is generated dynamically from the XML content by an application written in Delphi.NET. It currently outputs <span style="font-family: Wingdings;">ü</span> which displays the tick correctly in Internet Explorer and Chrome, but displays...

Deserialize XML with ampersand using XmlSerializer()

The following code breaks when the XML has data like "Lord & Hogan". Any suggestions? Thanks, Ken private T GetResponse<T>(String apiObject, String query) { //Deserialize XML into the type specified. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(BuildRequestUri(apiObject, query)); using (Http...

TcpClient.GetStream().Read() vs. TcpClient.Client.Receive()

Hello, .NET allows two very similar ways to "read" from the network (assuming TCP connection): 1. TcpClient.GetStream().Read() 2. TcpClient.Client.Receive() By looking at NetworkStream source code - it seems that it's an extra wrapper over the underlying socket, which eventually calls Socket methods. Question: what's the benefit of...

log4net log files disappear when service restarted

We are using log4net to create our logfiles from Windows services, and we are using the RollingFileAppender rolling based on date. The version of log4net we are using is 1.2.9. Now for the issue. We are rolling based on date, and on the days we need to restart a service the log file for that day is not rolled. Example: Say today is ...

Data getting truncated on filedownload with Reponse.BinaryWrite() OR Response.TransmitFile() data

Okay so i have page which bacially gets a file as a Byte[] from a webservice which I then give a Save/Cancel dialogue to the user to save that file. This file can either be xml or cvs format. When the file is downloaded the file is incomplete e.g. This is what the file should have: USD,EUR,Euro,1.2,1.1,11/15/2009,15:23:27 USD,AUD,Austral...

Can a scope block with the "using" keyword react to exceptions?

Hi everyone, I have the need to do some logging within my code. I'm required to use an internal company-developed library to record some information. Here's how it works. Recorder recorder = Recorder.StartTiming(); DoSomeWork(); recorder.Stop(); // Writes some diagnostic information. To ensure that Stop() is always called, I creat...

Transport errors due to class location? (SMTP)

ASP.NET 2.0 internal (intranet) web app using Integrated Auth + Impersonation. Developed on dev server (where classes reside) and published to production intranet server. Please bear with me, I'm not a .NET developer! Due to Exchange server move & upgrade an old app with mail features broke. I found the SMTP code in a class file on the d...

Linq to XML, only take elements that have a certain child element

I would like to ask a follow up question to an oldie (but goodie) Reading the list of References from csproj files (though I am not the author of that question). In my parsing of the csproj files I need to select all Compile elements that have Link element as a child. I first attempted to extend the answer to the linked question as fol...

Auto FTP from a Directory

I want to monitor a directory and FTP any files that are place there to an FTP location. does anyone know how to do this in c#? Thanks EDIT: Anyone know of a good client that can monitor a directory and FTP and files placed in it? ...

Any native ZIP/Packaging for .NET3.5

I am looking for Zip/Unzip operation in my .NET application. I can see plenty of third party implementations, But is there one part of .NET framework? Or let me tell you what exactly I am looking for. I may just need to package a folder and need to give a particular extension to it. ...

Reference two equal assemblies, only public keys differ

My Visual Studio 2008 project references two (external) assemblies (A+B) both of which happen to be referencing the same third assembly (C). However, assembly A expects assembly C to have a public key which is different from what assembly B expects it to have. Here's an example of the obvious exception: Could not load file or assemb...

How to return an array of .NET objects via a COM method

I have a .NET assembly. It happens to be written in C++/CLI. I am exposing a few objects via COM. Everything is working fine, but I cannot for the life of me figure out how to return an array of my own objects from a method. Every time I do, I get a type mismatch error at runtime. I can return an array of ints or strings just fine. ...