.net

How can I find out who created a file in Windows using .NET?

I need to find out who created a file using .NET I have already tried the following: string FileLocation = @"C:\test.txt"; FileInfo droppedFile = new FileInfo(FileLocation); FileSecurity fileSecurity = droppedFile.GetAccessControl(); IdentityReference identityReference = fileSecurity.GetOwner(typeof(NTAccount)); string userName = ident...

Visual Studio Designer not happy with my TabControl, anything I can do? (.NET / C#)

Hello, I have a class that extends TabControl, basically to have one with the tabs down the left hand side instead of along the top. To do I have set it to be custom drawn. The problem is when this is put onto a form via the designer, it easily makes the designer loose track of itself and just give up and display nothing. To fix it I h...

place cursor at end of text in memo field (.net app)

Hi is there a way when a page opens, to place the cursor at the end of a large memo field so users can automatically start entering text at the end of the field, rather than have them scroll down first? thanks DD ...

xClassNotDerivedFromElement error when adding Code Behind to Resource Dictionary in silverlight

I need to add code behind class to Resource Dictionary as described in this question. (I know that this is not a good practise but it should work based on the comments for linked question) .I'm referencing the code with x:Class attribute: XAML (separate Resource Dictionary file): <ResourceDictionary xmlns="http://schemas.microsoft....

Grid View with dictionary as datasource

Hi, Please help me out... I need to set a dictionary as datasource to a GridView. The dictionary contains objects with for example the attributes start and finish. I have only found information about connecting datasets, resultsets, sql adapters and so on to GridViews. The GridView im trying to present my dictionary with, should also b...

Most efficient (for reads) way of modelling a One to Many relationship with EF4

This is a fairly simple question (or at least from the outset it should be). I am looking into efficient ways to model a One to Many relationship where the many is the same type. Example Say we have a Person Entity, and this person has 0 to many Sub-Persons, and the Sub-Persons have 0 or 1 Parent-Person. The answer should take into c...

Checking SQL server running on a remote machine

Hi to all, In my installer, I am using System.Data.SqlClient.SqlConnection(connectionstring) to check if I can connect to the SQL server instance. When a user provides the connection string, I remove the "initial Catalog=..." part and try an SQLConnection.Open(). If all is fine, then I proceed in setting up the database (i.e. attaching ...

Referencing Assemblies in a .Net Application

Hi all, In my application, I would like to load Assemblies that reside on a network share (The application itself is on that share, too) without having to add them to the project's output path. What I'd like to have is an output directory that contains next to nothing but the application. Merely adding the target directory to my projec...

Building a LINQ expression tree: how to get variable in scope

I'm building a LINQ expression tree but it won't compile because allegedly the local variable $var1 is out of scope: variable '' of type 'System.Object' referenced from scope '', but it is not defined This is the expression tree: .Block() { $var1; .If ($n.Property1 == null) { .Block() { $var1 = null; ...

Ajax request inside update panel...synchronous?

Hi, please bear with me, hope you can help me out: I have 4 .NET LinkButtons and a .NET Placeholder inside a .NET UpdatePanel. When i click one of the aforementioned LinkButton, a user control is loaded in the PlaceHolder; All LinkButton are set as AssyncPostBackTriggers of the UpdatePanel; It's all good so far...everything works out f...

How to dynamically bind all events in an object to an EventHandler?

I've got a list of identical (signature-wise) events (25+): public class SourceOfManyEvents { public event Action<EventInfo> FirstEvent = delegate { }; public event Action<EventInfo> SecondEvent = delegate { }; {...} } I know that more events will be added to the class down the road using the same signature. I'm keen...

Serious trouble with ILMerge and .NET 4.0

For the life of me, I can't seem to get my .NET 4 application merging properly with ILMerge. Even after setting /targetplatform, /lib, /ndebug and adding a custom ILMerge.exe.config file the output file doesn't work properly (it doesn't seem to be able to "find" the merged libraries). I've tried this and this to no avail. I can't even g...

.NET: Send a text message to all instances of the same application and read it

I need ability to reliably sync some chunks of textual data between all running instances of my application. What's the best way to make it? ...

Nhibernate cannot add + save items to my one to many collection.

I seem to have major problems getting a one to many relationship to work in nhibernate and my classes are public class Kitten { public virtual int? Id { get; set; } public virtual String Name { get; set; } } public c...

How can I generate a random English "sounding" word in .Net?

I know there have been several posts about random word generation based on large dictionaries or web lookups. However, I'm looking for a word generator which I can use to create strong password without symbols. What I'm looking for is a reliable mechanism to generate a random, non recognised, English word of a given length. An example ...

How can I pass a property as a delegate?

This is a theoretical question, I've already got a solution to my problem that took me down a different path, but I think the question is still potentially interesting. Can I pass object properties as delegates in the same way I can with methods? For instance: Let's say I've got a data reader loaded up with data, and each field's valu...

XML data bases and ORM

Hello, A few years ago I used the Hibernate ORM for mapping database data to the objects and manipulate it. Currently I have xml database and the next question, Is there orm for the xml databases or something like this? It is my mistake I did not put technology, I need ORM for .net. ...

Inserting/embedding a file to a DOCX file - determining file-type

Let's say I have an API which lets clients insert a file into a DOCX template, they just pass a path to the file. If it's an image I just want to add an image to the file, if it's something life RTF/DOC then I can maybe embed it so the content is visible, if it's some other type like MP3 or PDF then it might simply embed with an icon. I...

Where to begin with programming for robotics?

Ok so i've been interested in robotics for a while and had a project in mind. Building a small remote controlled vehicle-robot/ unmanned vehicle-robot. Hopefully with the ability to read in data from sensory devices(gps,thermometer etc) and write the data to some kind of device. The idea(s) had been on the backburner for a while until i ...

How to call a dot net asssembly / namespace in XSLT

I am writing dot net code within my XSLT. It gives me below error when I call any namespace OR write "using" directive within XSLT. Error- "Could not recognize 'com.myassembly' " Is it possible to use any assembly within xslt? ...