I used to call GetComputerObjectName(NameUniqueId, ...) to get an Active Directory ID of local machine. Trying to get same functionality in .NET, does it exist, or is p-invoke the best way to achieve this goal?
...
Ok, I have a multi-line string I'm trying to do some clean-up on.
Each line may or may not be part of a big block of quoted text. Example:
This line is not quoted.
This part of the line is not quoted “but this is.”
This one is not quoted either.
“This entire line is quoted”
Not quoted.
“This line is quoted
and so is this one
and so is ...
What is the best way to convert a string into a Type object in .NET?
Issues to consider:
The type may be in a different assembly.
The type's assembly may not be loaded yet.
This is my attempt, but it doesn't address the second issue
Public Function FindType(ByVal name As String) As Type
Dim base As Type
base = Reflection.A...
When you need to have very small objects, say that contains 2 float property, and you will have millions of them that aren't gonna be "destroyed" right away, are structs a better choice or classes?
Like in xna as a library, there are point3s, etc as structs but if you need to hold onto those values for a long time, would it pose a perfo...
hi
Assume we created strongly typed DataSet which consists of two tables - Categories and Products.
Anyways, typed DataSets enable strong type checking. What follows are examples I’m aware of where strong type checking is applied:
a)
Instead of performing string-based collection lookup, where entering the wrong name of a table or...
Can someone point me to a good tutorial explaining the Entity Framework using an XML file instead of a database?
I have seen some good tutorials with SQL databases, but I can't make the leap to an XML file.
Thanks!
...
I read it in lots of places including here that it's better to make structs as immutable.
What's the reason behind this? I see lots of Microsoft-created structs that are mutable, like the ones in xna. Probably there are many more in the BCL.
What are the pros and cons of not following this guideline?
...
If you plan to write a very computationally intensive parallel application, what guidelines would you use to design your objects (whether classes or structs, or anything else) to maximize your potential of getting the most out of the parallelism.
I am thinking of an application that say interprets/compiles a tree-like graph of objects t...
Okay, so if I override Equals, I need to override GetHashCode and vice versa.
But I just wonder: Should I always override these two in any class? Especially if I know that I will use them in a Dictionary or similar collections? While this is fairly straight forward, it's still an extra work for every class.
Is the System.Object impleme...
If I override Equals and GetHashCode, how do I decide which fields to compare? And what will happen if I have two objects with two fields each, but Equals only checks one field?
In other words, let's say I have this class:
class EqualsTestClass
{
public string MyDescription { get; set; }
public int MyId { get; set; }
publi...
I have written a .NET web Service that is to be consumed by a client outside of my control (my server is a simulator for a live server written in PHP). The web service works as desired but the client does not have the ability to add the .asmx extension, or any extension for that matter, in their calls. They basically use http://localho...
I have a piece of data. At the moment, it's an XML file, but the architecture may change. So let's assume for the moment it's a C# Class.
When I store the data on disk or in the database, I need to add some sort of signature or fingerprint or checksum or whatever to ensure that no one can modify the data. The caveat: even an administrat...
I'm logging errors to the event log using the usual:
System.Diagnostics.Trace.TraceError("<" + purpose + "><time>" + DateTime.Now.ToUniversalTime() + "</time><message>" + message + "</message></" + purpose + ">");
and am wondering if there is a way to call this log file and display it for the user (either in my own format or by openi...
How to authenticate local windows user account in C# 3.0. Windows OS on which i have to validate the password is Vista and Win2K8.
Note: User account is a local account and not an domain account.
I found a solution in C# 3.5(PrincipalContext class), but could not find in 3.0 framework.
Please suggest, thanks
...
I have a LINQ to SQL entity called Job which is just a simple table in SQL. Most of the time it works for what I need but occasionally I need more fields to be populated in this entity. I know I can use partial classes to add new fields to the LINQ generated class, but my question is how do I populate this extra data? For example, I have...
Hey.
I'm writing powershell script that simulates actions performed by user on the page.
I have a problem with performing click on a button. Page has form and inside button that saves changes to database:
input type="button" onClick="__doPostBack('someIdentifier','SAVE')" value="Save changes"
I need to invoke that from the client si...
I was checking out streaming in the Programming WCF Services book, and I spotted a line about configurating.
You will need to configure the binding on the client or service side (or both) per required stream mode
So what is this?
How I know where I should configure them?
And is this a common thing with WCF?
Seems bit weird to me....
Right now, when the user want to exit my application, I do the few things I have to (ie disconnecting from the server, saving the user data...) and then I do the following :
Exit all my mainloops using booleans
abort the threads still running (typically, my server polling thread)
kindly call Application.Exit();
This takes a few seco...
Does anyone have an experience with some discrete event simulation library that could be used in .NET (C#)?
Despite the basic functionality for queing events and dispatching them, it would be fine to have some non-deterministic behavior (e.g. failures simulation).
I have some tips and I am even considering to write my own, but first, I...
Creating Unit Tests in VS2008 (rightclick, create unit tests) causes a lot of references to be added to my testproject. These are the same references that the project being tested is using.
Why is this necessary?
Is there an option somewhere to turn it off?
...