.net

MEF and unmanaged code

Is there a way of getting MEF to load unmanaged code, such as com objects that are not written Java or are native Win32 code ? ...

Multi-threaded library calls in ASP.NET page request.

I have an ASP.NET app, very basic, but right now too much code to post if we're lucky and I don't have to. We have a class called ReportGenerator. On a button click, method GenerateReports is called. It makes an async call to InternalGenerateReports using ThreadPool.QueueUserWorkItem and returns, ending the ASP.NET response. It doesn...

Using "Microsoft Save as PDF" add-in programmatically without installing Word

The sample code in this article for creating a PDF from a Word doc works great if you have word installed on the machine. http://msdn.microsoft.com/en-us/library/bb412305.aspx I'm curious if it is possible to do this without having to install Word. ...

How to use SqlBulkCopyColumnMappingCollection?

Hi I want to make one SqlBulkCopy method that I can use for all my bulk inserts by passing in specific data through the parameters. Now I need to do mapping on some of them. I don't know how to make a SqlBulkCopyColumnMappingCollection since that was my plan to pass in the mapping collection in and use it. However I don't know how to m...

newbie: how to change dotNetOpenAuth GoogleAddressBook sample to retreive more than 25 contacts?

How do you suggest I proceed in changing the GoogleAddressBook sample to retrieve > 25 contacts? Google suggests using AutoPaging=true on http://code.google.com/apis/contacts/docs/2.0/developers_guide_dotnet.html#retrieving_without_query If this is still valid, how can I go about passing this parameter in the DotNetOpenAuth sample prov...

Clean obj directory in Visual Web Developer Express 2008

I am using the following post-build event line to delete my project obj/ directory in VS WebDev 2008: rmdir $(ProjectDir)obj /s /q This seems to delte the files but leaves an empty Debug/Release directory in there, and either complains that "directory is not empty", or it silently fails to delete obj and obj/Debug. What I am doing wro...

How do I launch .net windows forms application with no visible windows?

I have a .net windows forms application that needs to open directly to the notify icon (system tray) with no visible windows. I realize that I can do this in the onshown event or something like it. But if I do that I get a flash of the window. How can I avoid that flash? I have tried modifying my Program.cs file to look like this: A...

How to check if a Windows file is readable/writable?

First off: I know that this isn't reliable for actually checking if I can write. I'm writing a file transfer client, and want feature parity between the "remote" and "local" file browser panes. I fully understand I will have to handle any permission related exceptions for any operation performed regardless; it's not a programming check i...

Does unboxing just return a pointer to the value within the boxed object on the heap?

I this MSDN Magazine article, the author states (emphasis mine): Note that boxing always creates a new object and copies the unboxed value's bits to the object. On the other hand, unboxing simply returns a pointer to the data within a boxed object: no memory copy occurs. However, it is commonly the case that your code wil...

Most efficient way to compare a memorystream to a file C# .NET

I have a MemoryStream containing the bytes of a PNG-encoded image, and want to check if there is an exact duplicate of that image data in a directory on disk. The first obvious step is to only look for files that match the exact length, but after this I'd like to know what's the most efficient way to compare the memory against the files....

How to hide Extension ( for eg .aspx ) in the URL ?

How to hide Extension ( for eg .aspx ) in the URL ? ...

How does .Net implement generics based on C++ template knowledge?

I have the knowledge of C++ template, but don't know Java. Would someone explain to me? ...

Restricting access to records. Is claim-based permissions a good idea.

in .net Claim-based identity framework If i wanted to restrict users to do an operation (view or edit) on let's say an account, a particular account #123456.(i am talking about business entity, like a bank account.) Is it a good idea to create a claim for each account they can view or edit? Any disadvantages of having a lot of claims ...

Millisecond-Accurate Scheduling of Future Events in C++/CLI

I need to create a C++/CLI mixed assembly that can schedule future calls into a native DLL with millisecond accuracy. This will, of course, mean setting a timer (what kind?) for a millisecond or three beforehand, then spinning until the moment and calling the native DLL function. Based on what I've read, I would guess that the callba...

Should IDataErrorInfo.Error check every property?

Should IDataErrorInfo.Error check everyShould IDataErrorInfo.Error check every property? Or can I trust any clients to call IDataErrorInfo.Item on every property? ...

Difference between using resgen and Resource files for localization

I've been reading a few articles about localization in .NET and it seems there's a couple of different approaches. Some of the articles are quite old though. Some articles suggest putting key value pairs into a text file and generating a .resources file using resgen. Others suggest using Resource files using the naming convention .en-US...

Is there an equivalent to C#’s Process.Start in PHP?

In .NET The Process class contains several useful properties/methods that allow developers to access process relative information. Is there any equivalent method or class in PHP? Is there any equivalent method in PHP like C# method "Process.Start()"? ...

Need idea to create the dynamic menu strip in windows application using data table.

Menu style: File . Tool -file1 -tool1 -file2 -tool2 -file3 -tool3 datable contains the rows like. col1 col2 ------------ File file1 File file2 File file3 Tool tool1 Tool tool2 Tool tool3 How to bind my data table value into menu strip dynamically i get my data table values from database dynamically. Based on my...

What's some simple F# code that generates the .tail IL instruction?

I'd like to see the .tail IL instruction, but the simple recursive functions using tail calls that I've been writing are apparently optimized into loops. I'm actually guessing on this, as I'm not entirely sure what a loop looks like in Reflector. I definitely don't see any .tail opcodes though. I have "Generate tail calls" checked in ...

Text Fade Effect in .NET Compact Framework

Hi all, I am creating a windows mobile application where i would like to do a fade In / Fade out of text which is getting displayed on a form. I am using C# for this purpose. Anyone can provide idea on this part? Thanks in Advance Regards Biju ...