|
Yes: under Project Properties/General tell it to only link to static libraries
Your incessant rantings indicate you have a brain the size of a pea, and the mental capacity of a bag of hammers. - John Simmons
|
|
|
|
|
hey wait does this mean that when I distribute a c#/.net desktop app, it can be run on a pc that doesn't have all of .net installed? I thought the entire runtime was required to have any .net app run...
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Bog wrote:
hey wait does this mean that when I distribute a c#/.net desktop app, it can be run on a pc that doesn't have all of .net installed?
I think you can't sadly.......
Bog wrote:
I thought the entire runtime was required to have any .net app run...
Yep!
So i would suggest looking into bootstrap[^] projects
HTH
"Creating tomorrow's LEGACY systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of code that knows whatz itz purpose" - I Dunnnnooooooo
|
|
|
|
|
What is the best way to create a singleton object in C#? I want an instance of my cache object to be shared by all the threads in my process. The process also happens to be an NT service. How does the garbage collection affect the singleton?
|
|
|
|
|
|
See this article:
Exploring the Singleton Design Pattern
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/singletondespatt.asp
The recommended solution, addressing all threading issues looks like this:
.NET Singleton Example
sealed class Singleton
{
private Singleton() {}
public static readonly Singleton Instance = new Singleton();
}
Sample Singleton Usage
sealed class SingletonCounter {
public static readonly SingletonCounter Instance =
new SingletonCounter();
private long Count = 0;
private SingletonCounter() {}
public long NextValue() {
return ++Count;
}
}
class SingletonClient {
[STAThread]
static void Main() {
for (int i=0; i<20; i++) {
Console.WriteLine("Next singleton value: {0}",
SingletonCounter.Instance.NextValue());
}
}
}
Kevin
|
|
|
|
|
Great link, thanks a lot
i had been using the following method all this time
public class Singleton
{
private Singleton();
private static Singleton singleton = null;
public GetSingleton()
{
if(singleton == null)
{
singleton = new Singleton();
}
return(singleton);
}
}
but the MSDN method seems much cleaner.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
I would like some help. I need source code that will recursively search the registry and delete text found. It would need to work on 95/98/NT/XP/2000. Any ideas? Any help is appreciated.
Thank You,
Derek
|
|
|
|
|
I am not sure anyone is willing to share any code like that. Have you figured out that if you don't use safely and properly such code, you could break the entire operating system of end-users ?
Back to real work : D-17.
|
|
|
|
|
Yes, but in my partular case the people that willo be using this are not end users, and are Microsoft Certified individuals, so That is not an issue. Any idea where such code could be found?
|
|
|
|
|
Derek Smigelski wrote:
are Microsoft Certified individuals, so That is not an issue.
Are you sure about that? The ten finger virus can infect anyone, but being MCP's they should be comfortable with the registry editor already!
"I dont have a life, I have a program."
|
|
|
|
|
Im sure it should be easy with the Registry and RegistryKey classes...and a bit of recursion. I wont test it though...
"I dont have a life, I have a program."
|
|
|
|
|
I'm new. Can you provide anyhelp or code? I will test it.
|
|
|
|
|
OK, I suggest you register and get all the benefits of being a CP'ian but here you go. The FindKey method will print the location of a specified key name (not value, but thats easy too).
private static void FindKey(RegistryKey key, string keyname)
{
string[] values = key.GetValueNames();
for (int j = 0; j < key.ValueCount; j++)
{
if (values[j] == keyname) Console.WriteLine(key.Name);
}
string[] subkeys = key.GetSubKeyNames();
for (int i = 0; i < key.SubKeyCount; i++)
{
try
{
FindKey(key.OpenSubKey(subkeys[i]), keyvalue);
}
catch (System.Security.SecurityException){}
}
}
public static void Main(string[] args)
{
FindKey(Registry.CurrentUser, "LeppieRules");
}
It shouldnt be a problem to go from there. Remeber USE AT OWN RISK, I TAKE NO RESPONSIBILITY AT ALL.
"I dont have a life, I have a program."
|
|
|
|
|
Will the code you provided find all text that I hardcode? From the top of the registry through the bottom, Dwords, text, values.. any text I find, I want to do an action.
|
|
|
|
|
I'm looking to return a list (perhaps in a list box) of all keys (ALL TEXT) that were found. If that Text appears anywhere in registry I want it added to my list. Then I can select/deselect what I wish and then delete the selected items. Allow someone to highlight and delete specific ones.
|
|
|
|
|
Hi All,
I would like to connect to a server through TcpClient class.
As I'm going through ISA Proxy which requires a NTLM authentication, I want to know how do I associate webproxy class with tcpclient (if thats possible).
I could do something like this with WebRequest class,
<br />
WebRequest objRequest = WebRequest.Create("http://www.someurl.com/abc.xml"); <br />
objRequest.Proxy = System.Net.WebProxy.GetDefaultProxy();<br />
objRequest.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;<br />
WebResponse objResponse = objRequest.GetResponse();<br />
but how do I do the same with TcpClient, I could not find a way to associate a proxy with TcpClient class.
I tried with
<br />
_socket = new TcpClient("http://www.google.com", port); <br />
for which i got the message saying host not found.
Thanks a lot.
Cheers
Kannan
|
|
|
|
|
I have created an OCX that contains a CArray of doubles
When I add the OCX to a Dialog in a VC6 project, the CArray memory is destroyed correctly on destruction.
When I add the same OCX to a form in a C# .NET project the debugger reports a memory leak for the CArray.
Why is the CArray memory not being destroyed on the OCX destruction?
The doubles are added to the CArray by value.
|
|
|
|
|
both are different, right? just as c++ and visual c++.
what i have seen is C# is for console applications, why Visual C# is not as popular as c#?
Tell me some good book for Visual C#.
@ish@
|
|
|
|
|
Aisha Ikram wrote:
what i have seen is C# is for console applications, why Visual C# is not as popular as c#?
hmmmm is that so?...i don't think there is any difference.
Aisha Ikram wrote:
Tell me some good book for Visual C#.
Inside C# by Tom Archer, Microsoft Press
(Good for learning the language)
Professional C#, Wrox Press
(Covers the base class libraries as well)
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Sijin, thanks for recommending the books .
Sijin wrote:
hmmmm is that so?...i don't think there is any difference.
Well that was just an idea, i was not really sure. but yes you are right, no difference except that Visual C# provides wizards and win forms like things.
@ish@
- When there is a will there is a way
|
|
|
|
|
As Sijin said there isn't any difference in the language.
C# is the language, Visual C# is a product produced by Microsoft which includes an IDE to help make the writing of C# programs faster. VC# includes a forms designer, as well as some wizards that will generate code.
James
- out of order -
|
|
|
|
|
Finally you shot down that bloody sig. At a time I thought exposing an annoying sig and evangelizing .NET at the same time was just too much wrong for a single guy.
Back to real work : D-17.
|
|
|
|
|
And depending on your viewpoint I can add to that by being a right-wing conservative
James
- out of order -
|
|
|
|
|
<sarcasm> That's horrible!</sarcasm>
This message was paid in part by the Republican National Commitee
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|