.net

Remove day name from DateTimePicker

I have a DateTimePicker and it is currently displaying "Friday, June 26 2009" How would I change it so it displays "June 26 2009"? ...

Where does Subversion save to?

I'm learning to work with SVN using Visual Studio.NET. Everything works fine and all but I couldn't figure out something: I have my original source code at c:\source I created a repository at c:\repo (svn://localhost) I added my solution to repository using VS.NET at svn://localhost/MyProject/trunk I checked out a working copy from r...

What is the strongest encryption available in .Net 3.5

I am storing files in S3 and want to encrypt the data to the maximum. I am using ThreeSharp S3 library and it uses DESCryptoServiceProvider to encrypt the data. How strong is DESCryptoServiceProvider compared to other encryption available in .Net? I have also seen services like Mozy.com that use 448-bit Blowfish encryption. I have do...

How can I find out what is wrong with a SetupDiGetClassDev interface in C#?

How do I find out what's wrong with the device info set returned? I'm re-writing my code again and I'm still hitting the same stumbling block. deviceInfoSet = SetupDiGetClassDevs(ref tGuid, 0, IntPtr.Zero, (uint)SetupDiFlags.DIGCF_PRESENT ); if (deviceInfoSet.ToInt32() == INVALID_DEVICE_HANDLE) { int errCode = Marshal.GetLastWin32Err...

How to create a rounded rectangle at runtime in Windows Forms with VB.NET/C#?

Hello, I woud like to create a filled rounded rectangle at run-time and assign it as content of a PictureBox (already created and hidden) in Windows Forms. Do you have an idea how can I implement it? thank you in advance ...

Excel VSTO sort dialog box C#

I'm trying to rewrite some VBA code in Excel VSTO. The VBA code is as follows: Application.Dialogs(xlDialogSort).Show When I try to do the same in VSTO I find that the same method needs 30 arguments! The signature is "Show(object Arg0,object Arg1, etc.)" Globals.RiskViewerWorkbook.ThisApplication.Dialogs[XlBuiltInDialog.xlDialogSort...

C#: How to figure out, if a Windows Account is Password proteced

I want to know, if a WindowsAccount is Password protected. For security reasons, you cannot get the Password, that’s clear, but there must be a way, to find out, if a Password is set. public bool IsAccountPasswordProteced(String userName) { String entryString = "WinNT://" + Environment.MachineName + ",Computer"; DirectoryEntry ...

Better CSS in .NET?

I'm getting slightly jealous of the innovation I'm seeing from the Python and Ruby community around CSS. For example, see: http://sandbox.pocoo.org/clevercss/ http://lesscss.org/ http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html That said, my question is two fold. Could these library's be easily "ported" to .NET via IronRuby...

Automated W3C Validation

I'd like to use MSBUILD to check the validity of both the rendered HTML and CSS of all pages in a site, and break the build on errors. Can anyone recommend a strategy to validate HTML and CSS in an automated build? Are there any tasks out there to do this now? ...

Windows App (One Click) Vs Web App

We are moveing our old Access VBA / SQL 2005 application to new technologys and have 2 options do we build a Windows Form Application with Microsoft One Click Deploy or a ASP.Net Website? The application is a work force mangement system booking jobs dynamic scheduling gantt chart components. It will be used by 400 + Users over 20 Locati...

Why won't C# inline functions with struct parameters?

At http://blogs.msdn.com/ericgu/archive/2004/01/29/64717.aspx, we learn that C# will not inline methods with structs as formal parameters. Is this due to potential dependence on the stack, e.g. for recursion? If so, could I potentially benefit by turning struct parameters into ref parameters like this? public int Sum(int i) { return...

How to pass a nullable type to a P/invoked function

I have a few p/invoked functions (but I'm rewriting my code at the moment so I'm tidying up) and I want to know how to use/pass a nullable type as one of the parameters. working with int types isn't a problem but given the following: [DllImport("setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern IntPtr SetupD...

Why Not Close a Database Connection in a Finally Block

Major Edit: I misread the article! The comment was in regards to the finalize method of the the class not the finally block :). Apologies. I was just reading that you should not close or dispose a database connection within a finally block but the article did not explain why. I can not seem to find a clear explanation as to why you w...

Create instance of COM class dynamically in .NET

I can load COM DLLs that are registered on my machine like this: Type type = Type.GetTypeFromProgID("MYCOMDLL.ClassName"); object boxed = Activator.CreateInstance(type); I can then poke around invoking methods etc. How can I achieve this from a DLL file that is not registered on my machine? Something like this magicode: Type type =...

Data provider to support SqlServer and Oracle

Hi All, I'm working on an ASP.Net application that uses .NET 3.5 framework. I need to implement a provider that works well with both Oracle and Sql Server, and also maybe MySql, because we are going to sell the product to clients who may have any one of these databases and the application should be able to communicate with any of these d...

.NET Google Calendar API Sort Events by Date

I have been reading the docs and playing with different EventQuery parameters for days now. I am using C# .NET with google's .net api to get the events from a public calendar I set up. I can get the events from the api just fine but I can't get it to give me the next upcoming events by date. My calendar has mixed recurrence events wit...

SQLHelper Class

Hi, Is there a recent version of the SQLHelper class out there. I've been using one for a few years now and was wondering if there is a new version out there for .NET Framework 2.0 or 3.0. I prefer this on small projects vs Microsoft Data App Block (which I use on larger projects). I came across this link http://www.microsoft.com/d...

Obtain output files from a MSBuild project

Is it possible to obtain a list all all the output files from a MSBuild project? In a simple project, I could do something like <CreateItem Include="$(OutputDir)**\*"> <Output ItemName="AllOutputs" TaskParameter="Include"/> </CreateItem> but my projects are part of a larger build, and all outputs go to a common location, I wan...

How to read a csv file into a .net datatable

How can I load a csv file into a System.Data.DataTable, creating the datatable based on the CSV file? Is there a class library for this or can I use ADO.net to connect to the file? ...

How to log an application's entire stacktrace in .net

I've just started work on an existing .net application with about 40 active projects. While familiarizing myself with the project, I find myself constantly stepping through the application just to learn the structure and logic flow. It would make this process so much easier if I could let the application run and log every method call and...