|
Hi
My installer is unable to remove assembly from Cache.i tried to run rd/s/q assemblyName command by starting Process but it`s giving access denied error,following is my code:
Assembly a = Assembly.LoadWithPartialName("MyAssembly");
curdir=Directory.GetCurrentDirectory();
getParent=Directory.GetParent(a.Location.ToString());
Console.WriteLine(getParent.ToString());
getParent=Directory.GetParent(getParent.ToString());
Console.WriteLine(getParent.ToString());
getParent=Directory.GetParent(getParent.ToString());
Console.WriteLine(getParent.ToString());
Directory.SetCurrentDirectory(getParent.ToString());
Console.WriteLine("Current Directory");
curdir=Directory.GetCurrentDirectory();
Console.WriteLine(curdir.ToString());
a=null;
System.Diagnostics.Process myproc=new Process();
myproc.StartInfo.RedirectStandardOutput=true;
myproc.StartInfo.UseShellExecute=false;
myproc.StartInfo.FileName="cmd.exe";
myproc.StartInfo.Arguments="/C rd/q/s MyAssembly";
myproc.StartInfo.WindowStyle=ProcessWindowStyle.Normal;
myproc.Start();
Console.WriteLine(myproc.StandardOutput.Read().ToString());
myproc.WaitForExit();
Console.WriteLine("Current Directory After Finishing of Process");
curdir=Directory.GetCurrentDirectory();
Console.WriteLine(curdir.ToString());
The executed command gives following O/P
MyAssembly\100~1.0__\MyAssembly.dll - Access is denied.
-1
|
|
|
|
|
intresting thing that when i run rd/s/q assemblyName on Command Prompt,it removes the file successfully
is there some .NET restriction to remove assemblies within framework?
|
|
|
|
|
|
hi,
I am a new .net programmer.Can any one tell what are the major classes and the that i need to go through in .net.Just like java has utill package which we use a lot in the programming.Can any one tell where I can find the description of these classes.
Satish
|
|
|
|
|
|
Ok here's my take, from most used namespaces (packages in java?) to least used (but still used alot).
1. System - all things common to the framework, eg object, string, primitives.
2. System.Collections - few handy list classes.
The above is common to most, my personal preferences follows.
3. System.IO - all stream related classes, including the overlooked StringReader/Writer classes.
4. System.Reflection - allows you to get info at runtime for any class (including your own).
5. System.ComponentModel - type convertors.
6. System.Windows.Forms - all UI classes.
7. System.Xml - basic XML goodies.
8. System.Text - most notably StringBuilder class.
9. System.Net - basic network client classes.
10. System.Text.RegularExpressions - RegularExpressions.
11. System.Xml.Serialization - XML (de)serialization.
12. System.Runtime.InteropServices - support for calling lecagy dll's.
And finally you might wanna look at System.Data that has support classes for database interopablity, and the ASP.NET related namespaces (System.Web.* ) for web stuff.
HTH
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
If you have Visual Studio, try typing "System." in a function. It'll bring up a list of all the namespaces and objects there, along with brief descriptions. SharpDevelop does the same thing, if you want a free IDE.
|
|
|
|
|
hi,
Thank you all for giving this information.I think this will help me a lot to learn.
Satish
|
|
|
|
|
hi
1.how i can determine the current user keyboard language in web application when page load?
2.how i can change it to specefic language?
thanks
|
|
|
|
|
1. I doubt you can.
2. I sincerely hope there is no way to do this.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
1) Keyboard language? You can't determine the web client keyboard from the server side. There is nothing that passes that information from client to server.
2) You can't! There is no way you can change a system-wide setting from inside the client web browser.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
How i can do an "Open Window" in C# code area with getting a specific URL?
thanks
|
|
|
|
|
You'll have to be more specific about what you want to achieve. What do you mean by "Open Window" and "code area"? And how does this URL come into play?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to do some thing like : a redirect in a new window with a specific URL , in code area : c# code behinde file.
as like as HyperLink tag or link tag.
|
|
|
|
|
I have no idea how to do it. This question really belongs in the ASP.NET Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
In my code I have a bottleneck which consists of a cpu-intensive loop of
size LENGTH. What I did was to divide that loop into two threads, Thread1
doing the 0 to LENGTH/2 part, and Thread2 doing the LENGTH/2 to LENGTH part.
There is no synchronization between threads, so they should work pretty
freely.
My machine has two processors (dual P3, Windows 2003 server). Now comes the
problem: when running the program, both threads are scheduled on the *same*
processor! I checked many things, for example:
1) Added a while(true); infinite loop, and it resulted in each thread be
scheduled to another processor (this was a test of course, I don't need an
infinite loop!).
2) Added the following code the loops in each thread:
for (int i = 0; l < 10000000; i++);
Just an empty loop that wastes CPU. Strangely enough, this somehow signals
to the scheduler that the threads are cpu-intensive and so each thread is
scheduled on different processor.
I would like to mention again that even without this wasteful loop each
thread is already 100% cpu-intensive, and so it is very strange that the
scheduler does not assign each thread to seperate processor.
As a last resort, I tried using a Win API call to SetThreadAffinityMask to
manually assign each thread to seperate processor. This to no avail, as my
request was ignored! (although the SetThreadAffinityMask function did not
return a fail status.) Again, strangely enough, when I use
SetThreadAffinityMask in the while(true) example above to ask the scheduler
to assign both threads to same processor, the scheduler does respect the
request and assigns both threads to same processor.
Finally, I have to mention that within the loops many memory accesses are
done (though no memory allocations). Is it possible that because of this the
scheduler places both threads on same processor to share L1 cache? (Though
after many years of parallel programming in C/C++ I have never encountered
such a strange behavior).
And if not, is it possible that the problem is because of a bug in .NET
Framework thread handling?
Thanks in advance for any reply that might shed some light on this mystery.
|
|
|
|
|
|
I tried to use ProcessThread.ProcessorAffinity, but how do I get a ProcessThread object? In my thread I can get the current thread using Thread.CurrentThread property, but that will give me a Thread object. How do I move from that to a ProcessThread type?
|
|
|
|
|
The only way I've found so far is to use the Process.Threads property to get a ProcessThreadCollection of the threads. I can't find any decent way to figure out which ProcessThread is which Thread -- Thread has the Name property but not Id, and ProcessThread has Id but not Name.
One crazy way to figure it out might be by looking at the ProcessThread.StartTime property. The newer object would be the new thread that you created. It's absolutely horrible, but it might be a temporary solution if you're in a hurry. Maybe you can isolate it in a private function so that you can replace it easily in the future?
|
|
|
|
|
|
Hello,
Is it possible to find out how many methods are listening to a certain event? For example, can I find out if there are one or more methods listening to the DragDrop event of a control?
If I can't find out the exact number of methods listening to an event, can I somehow remove all listeners of that event at once?
Thanks for your help,
-Flack
|
|
|
|
|
Do you mean how many eventHandler like this.eventName+=your method ???
ByMindOnlyYouCanDoIt
|
|
|
|
|
Right. Lets say some event handlers were added to an event using +=. Is there a way to find out how many handlers in total subscribed to that event?
Or, after adding some event handlers using +=, is there a way to remove all of them at once (even if you dont know how many handlers are subscribed)?
-Flack
|
|
|
|
|
Yes I pasted such a method only a few days back, but for a delegate, which of cource an event is. Here we go (in the class that defines the vent, else it wont be accessible from within the compiler, use reflection otherwise).
int eventcount = SomeEvent.GetInvocationList().Length;
xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots
|
|
|
|
|
I'm trying to log some trace information, and the stack trace isn't giving me sufficient details, so i'm having to log some additional information in a custom Trace class.
I'm just looking for a way to find out what the method name and signature is of the one that is currently being executed by a thread.
Cheers
Cata
|
|
|
|