.net

Application runs fine when executed directly, fails as scheduled task (security issues)

I wasn't sure if this should go here or on serverfault. I have an application that loads some files from a network share (the input folder), extracts certain data from them and saves new files (zips them with SharpZLib) on a different network share (output folder). This application runs fine when you open it directly, but when it is se...

Memory leak with ContextMenuStrip

I'm creating a lot of custom controls and adding them to a FlowLayoutPanel. There is also a ContextMenuStrip created and populated at design time. Every time a control is added to the panel it has its ContextMenuStrip property assigned to this menu, so that all controls "share" the same menu. But I noticed when the controls are removed...

Why Microsoft not provide for C# a static Win32 class with the most native functions and structures inside like windows.h?

Everybody who used P/Invoke of Windows API knows a long list of declarations of static functions with attributes like [DllImport ("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] The declaration of structures copied from Windows headers like WinNT.h or from web sites like www.pinvoke.net take also a lot of place in our p...

How to encode into\decode from UTF-8 string in WPF ?

So I have a string like Русское Имя how to represent it as real string with wcf textBox? And How to encode for example russian string inputed into textInput into UTF-8? ...

Editable TreeView

I need a treeview with the following features: ability to drag and drop nodes inside the treeview there are buttons on the top, that allow to move items up and down. editable node text Is there any implementation of this available? If not all, Is there an implementation of feature 1 available? ...

How to bind dropdownlist data to complex class?

Hi I am using asp.net mvc 2.0(default binding model) and I have this problem. I have a strongly typed view that has a dropdownlist <%= Html.DropDownList("List", "-----")%> Now I have a model class like Public class Test { public List { get; set; } public string Selected {get; set;} public Test() { List ...

POP3 Transmission Process

Hi All I was wondering if anyone could help me out (not with code, although that would be appreciated), with the logic behind checking and retrieving messages from a POP3 mail server. I.e. Establish connection Validate credentials Enumerate message list Check each message to see if it's "new" Download "new" message(s). Would this be...

How to change the looks or improve the looks of the VB.NET application?

Hey Guys We are very much bored with use of very powerful but very dirty looks of VB.Net Controls. We made application in VB.NET 2005. Now we want to change the look and filed of the application. we had tried to change with by changing colors and font but it still looks like very dirty. So how we change that, I had heard about WPF but n...

Samsung UMPC, Built in Camera doesn't support DirectX how can I use it?

The Samsung Q1 Ultra, is the perfect device for my software except that the built in camera seems to be incompatible with standard DirectX drivers, so my .Net camera implementation can't use the device. I have limited experience in this area.. Even Skype can't access this camera, but a little program from Samsung can.. I've looked at t...

.NET: Which strategy is better for populating a gridview? using a Data Table and bind it or using a data reader?

hi ASP.NET: Which strategy is better for populating a gridview? filling a Data Table and bind it or using a data reader ? Which one has a better performance? ...

Keyword Implementation in C#

Hi All Is there a way, and how would I go about implementing my own keyword such as in, and as (etc), to be used in my code? Here is what I had in mind. I want to (just for my own personal reasons, I guess) add a few keywords of my own, one of which would be the "was" keyword: if(Control was Clicked) { // etc etc } ...

DataBinding to GridView

Hello, I Have a gridview object and i want to bind it to Object.. My Object is namespace DataBinding { public class BindingObject { public ColorInfo Color { get; set; } public string Name { get; set; } public struct ColorInfo { public string Red { get; set; } public string Green { get; set; } publi...

Does there exists a method to render an object using DebuggerDisplayAttribute

I have a number of classes that are decorated with DebuggerDisplayAttribute. I want to be able to add trace statements to Unit Tests that will display instances of these classes. Does there exist a method in the .NET Framework that will display an object formatted using DebuggerDisplayAttribute (or fall back to using .ToString() if no ...

content management system

I am building a website for a client who needs a content management system to go with it. The client requires features such as content staging, approving process before publishing a page, provision for templates (changing which changes the lay out for the whole website), entry and expiry dates for pages and content search. I am planning ...

Cannot create class diagram for simple dll class in Visual Studio 2010

Hi, It seems that there is a really annoying issue in Class Diagram designer in VS (my version is 2010 Ultimate, release, but the issue is also observed in VS 2008). When I'm trying to create a class diagram for particular simple class from DLL I'm getting the following error: "Some of the selected type(s) cannot be added to the class ...

Which collection type should a reposity return results in? (.Net)

When using repository based persistence in a .net application, which collection type should normally be used? IList, IEnumerable? For example, the FindAll() method. ...

doublebuffering not reducing the flicker

I am drawing an grid-work of objects in a Panel. when I scroll the the panel quickly I get a flicker. I thought that enabling the double buffering may take care of this but what I find is that it does not completely draw everything and I am left with blank sections. could anyone give me suggestions as to what may be happening and how I m...

Listening Port Permanently. if file is on my stream, Get file. How to?

i writed 2 client and server program. client send file also server listen port and than get file.But i need My server App must listen on 51124 port permanently. if any file on my stream, show me a messagebox "there is a file on your stream" and than show me savefile dialog. But my server app in "Infinite loop". 1) listen 51124 port eve...

Transaction within a Transaction in C#

I'm importing a flat file of invoices into a database using C#. I'm using the TransactionScope to roll back the entire operation if a problem is encountered. It is a tricky input file, in that one row does not necessary equal one record. It also includes linked records. An invoice would have a header line, line items, and then a total...

Call a dynamically generated method on a ILGenerator on the same type

Normally, when I want to call a dynamic method in another ILGenerator object that is writing a method on the same type I do the following : generator.Emit(OpCodes.Ldarg_0); // reference to the current object generator.Emit(OpCodes.Ldstr, "someArgument"); generator.Emit(OpCodes.Call, methodBuilder); //this methodbuilder is also defined...