I have written the following Utility class to get an instance of any class of name "className".
public class AssemblyUtils
{
private AssemblyUtils()
{
}
public static T GetInstance<T>(string assemblyName, string className)
{
T classInstance = default(T);
System.Reflec...
Hi
I switched from windows xp to windows 7 pro 64bit. When my computer was in xp I had 2 gigs of ram and overclocked my cpu to 3.0ghz now I have 4gigs of ram but had to lower my cpu to 2.8ghzs.
Ever since I been running windows 7 local host goes so slow when I run my asp.net mvc site. I don't understand why. It can take up to 20seconds...
Hi All, my first question here on Stackoverflow (wish me luck :))
So, I have a new site on my mind that I would like to create using as much "generation"-friendly stuff as possible due to the fact that I'm getting tired of coding the same stuff all over again.
This has made me take a peek at the SubSonic project (have been looking at t...
Up until now I used DateTime.Now for getting timestamps, but I noticed that if you print DateTime.Now in a loop you will see that it increments in descrete jumps of approx. 15 ms. But for certain scenarios in my application I need to get the most accurate timestamp possible, preferably with tick (=100 ns) precision. Any ideas?
Update:
...
Is there a way to have a .NET assembly accessible for only authorized sources?
I mean I want to have a DLL that contains components, but I don't want anyone to be able to use these components but the other DLLs EXEs in my solution.
I do want them to be in separated DLLs though.
Restriction on namespace might also be a good idea if this...
it's kind of absurd(i think).
mono want to be a substitute to .NET, so why can't i run monodevelop with mono itself?
why do i need .NET for that?
you can see what i'm talking about in this link:
http://monodevelop.com/Download
just choose MonoDevelop 2.2 Beta 1
then choose windows and you will see :-)
thanks :-)
...
Which directory does FileDialog (OpenFileDialog/SaveFileDialog) uses?
When I show it from my application it opens folder which is not Environment.CurrentDirectory folder.
How can I get this directory path? Or it's controlled by the OS and I can't know it?
...
Hello,
I have repositories (e.g. ContactRepository, UserRepository and so forth) which encapsulate data access to the domain model.
When I was looking at searching for data, e.g.
finding a contact whose first name
starts with XYZ
a contact whose birthday is after
1960
(etc),
I started implementing repository methods such as Firs...
I wrote the following code for retrieving the selected text from the current webpage:
IHTMLDocument2 mainDoc = ...
for ( int i = 0; i < mainDoc.frames.length; i++ ) {
object refIndex = i;
var frame = (IHTMLWindow2)mainDoc.frames.item( ref refIndex );
IHTMLDocument2 frameDoc;
try {
frameDoc = frame.document;
} ca...
Is it possible, in C#, to create extension methods on a class but restrict visibility/accessibility within a class? (e.g. Extension Method A on class M is only accessible within class Z)
Example:
class A
{
String foo = "";
String bar = foo.MakeMillionaire("arg");
}
In above example I want the extension method "MakeMillionai...
I have a typical enterprise/business application that I am developing that includes orders, salespersons, contacts, reference data, etc... There will be at least 100 or more users on the system at a time who are entering new data, changing data, etc. I need to provide search capability across the application for almost all tables.
O...
How do I write a LINQ to SQL equivalent of:
INSERT INTO Table1 (field1, field2, field3)
SELECT field1, field2, field3
FROM Table2
WHERE (field1= @field1)
Thanks
...
HI, Any good resources to wrap my head around Aspect Oriented Programming?
PS:- I need to understand AO programming not the libraries or frameworks available for .NET or C# :)
...
I am using NHibernate and need to update/add an entity class(a) that can reference another entity class(b) that needs to have a unique "name" field.
So would it be best to:
query with NHibernate to find an existing entity(b) before the call to save entity(a).
create stored proc to handle this update/insert logic.
let table(b) uniq...
My .NET WinForms application connects to ftp server and downloads a file. To do that a password for the connection is required. The password should be stored in a configuration file, but it should be encrypted. The only solutions to do that that I've found include either securing whole config section (which is no use for me as in the app...
How can I access a controller instance from the view? E.g. I have a HomeController which then returns my Index view. Inside of that view I want to access the HomeController instance that created the view. How do I do that?
...
I have a multi-user ASP.NET MVC application. The users are not supposed to see or do anything with each other's data.
One of my controller actions is the obligatory POST to /Edit to edit a record (e.g. a contact). Now here is my problem: What if somebody forges a simple POST to /Edit (which automatically model-binds to my contact class...
We are currently using Fitnesse for sub system testing. [All our applications are in c#.net]
We are having lot of issues around Fitnesse.
We are planning to use another software for subsystem testing.
I recently heard about Story Teller subsystem testing and SOAP UI test tool.
Does anyone have any experience (good/bad) with these tools?
...
Hi,
I'm looking for a tool that keep GAC synchronized across different systems. when a new assembly added to one system, it should be GACed on other systems automatically.
Thanks
...
Please suggest me a method to save an XML file to the current installation directory of the application created using C#.
...