.net

Increase file upload size limit in iis6

Is there any other place besides the metabase.xml file where the file upload size can be modified? I am currently running a staging server with IIS6 and it is setup to allow uploading of files up to 20mb. This works perfectly fine. I have a new production server where I am trying to setup this same available size limit. So I edited t...

Best approach to Windows Forms rolling log output in TextBox

In a Forms application I'm displaying log output from a long running command-line application that generated a lot of output. I start the program in the background, and capture its output and currently display it in a TextBox using AppendText. I prefer to only display for example the last 1000 lines. Removing lines from a TextBox is expe...

Why is this property not getting set?

Hi folks, I'm having trouble trying to set the value of a property after i cast it. I'm not sure if this is called boxing. Anyways, the new variable is getting set, but the original is not. I thought the new variable is just a reference to the original. But when i check the intellisence/debug watcher, the original property is still nul...

Is this an inefficent use of casting?

Hi folks, this question is an extension to a previous question i asked (and was answered). I'm refactoring my code an playing around with / experimenting with various refactored solutions. One of the solutions i came up with (but wasn't happy with .. remember, i'm just experimenting with some personal coding styles) wsa the following c...

Checking existance before inserting via Linq to SQL

I'd like to know if there's an easier way to batch insert a set of records if they don't already exist in a table. For example I have a Tags table in the database having ID, Name columns - given a list of tag names I want to add only those that are not already present. Here's what I came up with: private static void InsertTags(IEnumerab...

Using LINQ how do I have a grouping by a "calculated field"

I am using LINQ to EF and have the following LINQ query: var results = (from x in ctx.Items group x by x.Year into decades orderby decades.Count() descending select new { Decade = decades.Key, DecadeCount = decades.Count() }); So this kind of gets me to where I want to be, in that I get the...

Add references manually

Is there anyway I can make the process of adding references to C# projects less painful? Every time I create a new C# class library project. I have to use the Add Reference dialog for 5 times at least. ...

.NET SMTPClient - where is pending outgoing mail stored?

If I've queued up some email to be sent via the System.Net.Mail.SMTPClent, where can I find this mail? With the Windows SMTP Client, it's in the C:\inetpub\mailroot folder - is there a similar folder for the .NET client? EDIT: Here's an example. If I turn off the outgoing SMTP server on my XP computer and then run an application that se...

Where is the implementation of InternalEquals(object objA, object objB)

Hello Friends while diassembling the .Net Source Code using Reflector, I came upon the Equals implementation in the Object Class and it refers to bool InternalEquals(object objA, object objB); Which again refers to internal static extern bool InternalEquals(object objA, object objB); I am now confused regarding where to find the...

Creating local user account c# and .NET 2.0

How can I create a local user account using .NET 2.0 and c# and also be able to set the "Password never expires" to never. I have tried using "Net.exe" using Process.Start and passing its parameters but it seems that the "net user" is unable to set the "Password never expires" to never. ...

Tool to Show Class Hierarchies in .NET

Is there a way/tool that could show me all the classes/interfaces that implement a certain interface in my project? In Eclipse (Java) I would use the context menu "Open Type Hierarchy" option, which would show me a (pretty) tree of types that extend the selected type. Is there a tool to do the same in .NET? ...

Looking for a simple OpenType API for .NET

Does anyone know of a good library that can parse OpenType files and provides information about font features in simple, understandable OO format? Thanks. ...

Enumerator Implementation: Use struct or class?

I noticed that List<T> defines its enumerator as a struct, while ArrayList defines its enumerator as a class. What's the difference? If I am to write an enumerator for my class, which one would be preferable? EDIT: My requirements cannot be fulfilled using yield, so I'm implementing an enumerator of my own. That said, I wonder whether i...

Managed Direct3D or XNA for non-game related 3D graphics programming?

Which is the preferred approach for doing .NET 3D graphics programming: Direct3D or XNA seem to be the current technologies, but which is best for non-game related programming? Also, has Managed Direct 3D been discontinued? XNA doesn't really seem to be appropriate for non-game development. ...

How to safely and effectively cache ADO.NET commands?

I want to use this pattern: SqlCommand com = new SqlCommand(sql, con); com.CommandType = CommandType.StoredProcedure;//um com.CommandTimeout = 120; //com.Connection = con; //EDIT: per suggestions below SqlParameter par; par = new SqlParameter("@id", SqlDbType.Int); par.Direction = ParameterDirection.Input; com.Parameters.Add(par); H...

When will a Comparer make Sort throw an ArgumentException?

The documentation for Sort says that Sort will throw an ArgumentException if "The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself." Apart from the example given, can anyone tell me when this would otherwise happen? ...

How-To: Copy dependent assembly in case it is not in GAC?

I am building a Setup Package using VS2008. This is a regular setup package installing a COM Add-In app for Outlook. It works Ok, so far. However I need to improve it a little... The story is that installation package copies all dependent assemblies into the installation folder of the add-in. For example, the COM Add-In depends on Mic...

Practical / Applied application security

Hello Everyone, Alright so here is my issue. I'm working a game engine that will eventually be multilayer. this engine allows games to be written in either a .Net language or Lua (the built in scripting engine). For security however I'd would like to prevent people from viewing these files and of course prevent them from editing them. M...

Does ironpython have libraries that replace the pywin32 extensions?

I have some old python code that uses the pywin32 extensions. Starting out with .net, I would like to port it to ironpython. The old python code uses things like pythoncom.com_error, pywintypes.Time and interfaces a COM module that implements the IDispatch interface. Does the .net libraries of ironpython have all I need for communicat...

how to get file from resources as a stream? (.net)

I've got few files in resources (xsd files) that i use for validating received xml messages. The resource file i use is named AppResources.resx and it contains a file called clientModels.xsd. When i try to use the file like this: AppResources.clientModels, i get a string with the file's content. i would like to get a stream instead. i do...