.net

What Happened to ASP.Net Mobile Web Forms?

Previously Visual Studio had templates for mobile web forms (not the mobile SDK). They appear to be gone in Visual Studio 2008 and the only solution I've seen is to download some templates from Omar here: http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-net-mobile-development-with-visual-studio-2008.aspx Is this supp...

How can I read MS Office files in a server without installing MS Office and without using Interop Library?

Interop library are slow, and need MS Office installed. Many times you don't want to install office on servers. I'd like to use Apache POI, but I'm on .NET. I need only to extract the text portion of the files, not creating nor "storing information" in office files. I need to tell you that I've got a very large document library, and ...

Getting / setting file owner in C#

Hi, I have a requirement to read and display the owner of a file (for audit purposes), and potentially changing it as well (this is secondary requirement). Are there any nice C# wrappers? After a quick google, I found only the WMI solution: http://www.softinsight.com/bnoyes/PermaLink.aspx?guid=8edc9d4c-0f2c-4006-8186-a3697ebc7476 and ...

Is there a way to determine when a .NET thread terminates?

I'm trying to find out whether there is a way to reliably determine when a managed thread is about to terminate. I'm using a third-party library that includes support for PDF documents and the problem is that in order to use the PDF functionality, I have to explicitly initialize the PDF component, do the work, then explicitly uninitiali...

Are there any good free .Net network libraries? (FTP, SFTP, SSH, etc.)

I'm a bit surprised I haven't found a good open source library for performing common network tasks. There are a few very good commercial libraries, but they're too expensive to use on an open source project. Anyone know of any? ...

Programatically creating Excel 2007 Sheets

I'm trying to create Excel 2007 Documents programatically. Now, there are two ways I've found: Manually creating the XML, as outlined in this post Using a Third Party Library like ExcelPackage. Currently, I use ExcelPackage, which has some really serious drawbacks and issues. As I do not need to create overly complex Excel sheets (th...

How to decouple a middle tier and a dataset to allow for unit testing?

Howdy, I have a question at SO asking how to wire a middle tier to a DataSet. I put up an answer showing what I had come up with, but I am not happy with the tight coupling. I have just started to get into testing and find it a good goal for my code. How would this code be de-coupled to allow for unit testing? Thank you, Keith ...

Is anyone using Microsoft Software Licensing and Protection Services (SLP) in production?

Microsoft has come out with this fairly new technology that I am considering using for a .NET 3.5 application. I am curious, is anyone using this technology already? I am worried that the use of the secure virtual machine will negatively affect performance. Also, the way Microsoft advertises the product, it seems as though the licensi...

Fixed Statement in C#

We have similar code to the following in one of our projects. Can anyone explain (in simple English) why the fixed statement is needed here? class TestClass { int iMyVariable; static void Main() { TestClass oTestClass = new TestClass(); unsafe { fixed(int* p = &oTestClasst.iMyVari...

Retrieving the original error number from a COM method called via reflection

I have a VB6 COM component which I need to call from my .Net method. I use reflection to create an instance of the COM object and activate it in the following manner: f_oType = Type.GetTypeFromProgID(MyProgId); f_oInstance = Activator.CreateInstance(f_oType); I need to use GetTypeFromProgID rather than using tlbimp to create a library...

Add to right click application menu in taskbar in .NET

Most applications only have "Restore, Move, Size, Minimize, Maximize and Close", however MS SQL offers extra options "Help, Customize view". Along those lines, is it possible to add to the right click menu of an application in the task bar? Note: I'm not referring to an icon in the notification area next to the clock. ...

How to clear event subscriptions in c#

Take the following c# class: c1 { event EventHandler someEvent; } If there are a lot of subscriptions to c1's 'someEvent' event and I want to clear them all, what is the best way to achieve this? Also consider that subscriptions to this event could be/are lambdas/anonymous delegates. Currently my solution is to add a ResetSubscriptio...

How do I determine the intersection point of two lines in GDI+?

I'm using .NET to make an application with a drawing surface, similar to Visio. The UI connects two objects on the screen with Graphics.DrawLine. This simple implementation works fine, but as the surface gets more complex, I need a more robust way to represent the objects. One of these robust requirements is determining the intersection ...

Best method of logging to txt file?

What would be the best method of recording to a log(.txt) from a console program? My program loops multiple times always outputting different data based on what the user wants, so im searching for the best, most efficient way to achieve this. i know i can always reopen a stream and then close it, but everytime i do that it would be writ...

Create MSBuild custom task to modify C# code *before* compile

I want to create a custom MSBuild task that changes my .cs files before they are compiled by csc.exe (but, of course, that doesn't modify them in place - I don't want actual source files touched). I am aware of PostSharp and other AOP frameworks for .NET and they are not an option for this particular project, plus I'd like to learn how ...

How can I write a scheduler application in .NET?

How can I write a scheduler application in C# .NET? ...

Automating Word Mailmerge not working as expected

I'm having a problem with some mail merge code that is supposed to produce letters within our application. I'm aware that this code is a bit rough at the moment, but we're in the "Get something working" phase before we tidy it up. Now the way this is supposed to work, and the way it works when we do it manually, is we have a file (the f...

7-Zip (7za.dll) .NET wrapper

I'm looking for code or a library that let's me control the 7-Zip unpacking functionality from c# code. ...

WebBrowser Control from .Net -- How to Inject Javascript?

I've tried this: string newScript = textBox1.Text; HtmlElement head = browserCtrl.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = browserCtrl.Document.CreateElement("script"); lblStatus.Text = scriptEl.GetType().ToString(); scriptEl.SetAttribute("type", "text/javascript"); head.AppendChild(scriptEl); scriptEl.InnerHtml ...

Wcf and Interfaces as Parameters

hi there, i have a library with some entities that share the same interface. clients and service share this assembly. now i wonder if there is a way to have this Interface-type as Parameter in my service contracts so that i can use the same method for all classes implementing the interface. the entities themselve are all decorated with...