.net

.NET component for conversion to PDF

Hi, I am looking for .NET component to convert different files into PDF format. Right now I need to be able to convert programmatically doc, xls and TIFF files to PDF. But I may need to deal with more file types in near future. I looked at Aspose.Words, it works good but for doc only. Is there any component on the market that would all...

How to query AD to get name email from lan id

I have some code in asp.net ( kindly given by someone else ) to query AD to get user name and email etc. using System.DirectoryServices; using System.DirectoryServices.ActiveDirectory; using ActiveDs; DirectorySearcher search = new DirectorySearcher(new DirectoryEntry(), string.Format("(samaccountname={0})", id)); if (s...

How to copy a System.Drawing.Graphics over another Graphics?

We got some code that implement printing using Printdocument and it does all the drawing directly on the Graphics object received in the PrintEventArgs. It would be more convenient if the code doing the drawing used another canvas and we would add this canvas to the PrintEventArgs Graphics after. Since the code already depends on the Gra...

Most awkward/misleading method in the .Net API?

In light of this question I thought it'd be really neat to have a similar question about C#/.Net. So, what is the most awkward or misleading method name of the .Net and/or C# API? ...

Suggestions needed for request-reply on ActiveMQ and Camel using Spring NMS on .NET

I am trying to use the ActiveMQ and Camel (running in broker) on .NET using Spring and NMS. In general, these components work brilliantly. I have a camel route for send/receive, and some code in .NET to handle this - works like a charm. The issue I am trying to resolve is for a request-reply integration pattern. Camel support this, a...

Use DataContext to create schema in an existing blank database file?

With a DataContext and a blank file-based database that already exists, is it possible to write the Data Context classes (i.e. the ones I added to the designer) to create the db schema? With a data context I only see the abilities to either: create a new database file and have its structure created at the same time, or to populate...

Way around ASP.NET session being shared across multiple tab windows

I'm storing some value in an asp.net session on the first page. On the next page, this session value is being read. However if multiple tabs are opened and there are multiple page 1->page 2 navigation going on, the value stored in session gets mixed up since the session is shared between the browser tabs. I'm wondering what are the opti...

Creating a Web Service to automatically get information

I want to create some sort of method of creating a web service that will run automatically and run DB queries and some API calls which will then store data that I can use/call without taking the processing or time penalty of doing it every time a user access my web service. Is this possible? If so, point me in the right direction on how ...

Find the focused control in a form (in .netCF)

I have a form that I want to know which control on it has focus. How can I do this? Best solution I have seen has me iterating all the controls on the screen. While doable, it seems like a lot of work just to know which control has the focus. ...

How to programatically send a TAB keystroke in netcf

I need to have my edit box work the same for both tab and the enter key. I have found lots of problems doing this in the application. Is there some way that I can send a tab key to the form/edit box. (Note that this has to be in the Compact Framework.) Solution: Here is what I ended up using: // This class allows us to send a tab ...

Encrypting Files with AES, Encrypting Key with RSA - Am I on the right track?

Overview: I'm trying to design an application that will encrypt files to safely send through Snail Mail (LARGE sets of data). I'm planning on using AES/RijndaelManaged encryption from .Net to encrypt the files initially, using a randomly generated key using RNGCryptoServiceProvider. I'm then encrypting this random AES key with a RSA Pu...

How do I extend a WPF application using an addin-like architeture?

Lets say I have a WPF application that shows a ListBox with an ArrayList -populated with objects of arbitrary types- as a source, and this application is hosted in an assembly 'A'. By default the ListBox will display the custom object 'ToString' method return value. If a data template for that object type is found, the ListBox will use ...

Gridview - Edit Mode - When I press return on my keyboard, the edit item index changes to the first row

When I am in edit mode on any row of my GridView and I press Return while the focus is in one of the row's textboxes, instead of triggering the update button, my GridView1.RowEditing event is fired with a NewEditIndex of 0 This causes the first row to become editable and I lose any values typed into the previous row. How can I stop thi...

Gridview - Is it necessary to grab data from database every time a filter, sort, or paging event occurs?

Regarding gridviews that are not bound to a Data Source Control: In most GridView tutorials that I have seen, when just about any GridView event occurs, the end of the event handler will include BindDataGrid(). In some form, these BindDataGrid() functions 1) Grab data from the database 2) Assign any Filter or Sort expressions to the da...

Save objects to a database?

So far in my .Net coding adventures I've only had a need to save information to files. So I've used XmlSerializer and DataContractSerializer to serialize attributed classes to XML files. My next project, however, requires that I save and retrieve information from a SQL server database. I'm wondering what my options are for doing this. T...

class modifier issues in C# with "private" classes

I had a class that had lots of methods: public class MyClass { public bool checkConditions() { return checkCondition1() && checkCondition2() && checkCondition3(); } ...conditions methods public void DoProcess() { FirstPartOfProcess(); SecondPartOfProcess(); Thir...

Implement "Open Containing Folder" and highlight file

This can be a handy functionality to have in a program that works with files/folders. It's easy enough to actually open the containing folder using: System.Diagnostics.Process.Start( *path to folder* ); ...but how do I go about actually selecting the target file within that parent folder? If I use the Process.Start method it actually ...

Range subtraction in the Excel Object Model

When using Excel Interop libraries from .NET, I can find a Range object representing the cell offset from Range X by calling something like. Range Y = X.Range[2,3]; But what should I do to perform the inverse operation, ie: I have two Range objects, A and B, and I would like to find out by how many rows/columns B is offset from A. D...

IEnumerable<T> representing the "rest" of an IEnumerable<T> sequence

If I am walking through an IEnumerable<T>, is there any way to get a new IEnumerable<T> representing the remaining items after the current one. For example, I would like to write an extension method IEnumerator<T>.Remaining(): IEnumerable<int> sequence = ... IEnumerator<int> enumerator = sequence.GetEnumerator(); if (enumerator.MoveNe...

get any UI element's on screen position for any application in windows

is there a way in any programming language, perhaps using the Microsoft SDK, to get the on screen position of UI elements within a window of any application ? If so, could you please provide guidance with an example perhaps? Thank you, It's been paining me for days! Please consider that it is an external application. So for example, if ...