|
You may be able to use the Assembly class to get the information you require.
Here is the example from the documentation:
Assembly SampleAssembly;
Int32 Integer1 = new Int32();
Type Type1;
Type1 = Integer1.GetType();
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
Console.WriteLine("CodeBase=" + SampleAssembly.CodeBase);
Look up the documentation for Assembly , particularly ExecutingAssembly and CallingAssembly to decide the best way to proceed for your circumstances.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry,
It is returning the path as "file:\C:\....\\....\TestResults\user_UKNML2009-10-16 16_39_37\Out".
I need debug or application executable path. (If i do some modification in code to reach up to the required path from the assembly path then it will not work for actual application output.)
|
|
|
|
|
I need help with how to copy a row into a new worksheet using C#. Presently I can search for the string but I can't figure out how to grab the row and copy it to a new worksheet. Can anyone help? My code is below.
for (rCnt = 1; rCnt <= range.Rows.Count; rCnt++)
{
for (cCnt = 1; cCnt <= range.Columns.Count; cCnt++)
{
System.Convert.ToString(xlWorkBook);
str = (range.Cells[rCnt, cCnt] as Excel.Range).Value2as string;
if (str == "Yellow")
String.Copy(str); //After if finds the yellow string I want it to copy it to a new worksheet this will take place for all yellow strings.
MessageBox.Show(str);
}
}
|
|
|
|
|
Hi there,
I want to start a process on a remote machine and as soon as the process is complete i want to start a local process.
Keep in mind that:
- I only have the UNC of the remote pc
- The process that must be run is stored on the remote pc and must be run on that pc.
- I do not want to map network drives (although it's highly unlikely that i should)
This is how I would do it if the first process was run on my local machine.
myProcess.Start();
myProcess.WaitForExit()
Thank you,
|
|
|
|
|
diePopster wrote: I want to start a process on a remote machine ...
You are going to need some communications vehicle between the two systems so the initiator sends a message to the remote telling it to start the process, and when it terminates to return a completion message. You could do this with sockets, or maybe WCF, although sockets may be easier to learn. Take a look at some of the links here[^] for more information, or search Google for 'WCF' if you decide on that route.
|
|
|
|
|
I believe you can do this using WMI. Read this[^] article or this[^] post.
Hope it helps.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
hi.
how can I see the list of files that a computer sent or recieved over a lan?
thanks
|
|
|
|
|
I don't think there is a single repository for something like that. Do you mean over a particular protocol?
|
|
|
|
|
FileSystemWatcher class might be of your interest. You can find a lot of samples related to this class' usage on web.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Windows does not track such information. There is no way to tell.
Also, since there are so many different ways of sending files and over so many protocols, there's no single way to find out even if that stuff was tracked.
|
|
|
|
|
hi every body.How can I see the list Of active computers over a lan?
thanks
|
|
|
|
|
hi,
one way is to ping over your network range.
each ping comes back u know the pc is active.
greetz
|
|
|
|
|
I want to write it's code with c#.
|
|
|
|
|
There is an article regarding this right here at CP. Search for that using appropriate keywords.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
what do you mean about stupid???
|
|
|
|
|
I am building mobile app in c# and RedFiveLabs NET60,
at the end the error message came up "the project file c:\users\adahada\AppDAta\Local\Temp\5p3kpxfc.4qo\Temp\MyDeployment1.genesisproj" cannot be oppened. the project type is not suppored by this installation.
Please how do i get pass these bottle necks.
thanks.
|
|
|
|
|
Enobong Adahada wrote: the project type is not suppored by this installation.
I think this message is the clue.
|
|
|
|
|
Check your installation. If you have installed Net60 correctly, you should be able to open this file.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
|
If a client (Client-A) wants data from a server that the server received from a different client (Client-B) then Client-A needs to connect to the server and request it. To connect to a socket on "localhost" use IPAddress.Loopback as the destination address.
|
|
|
|
|
Hi there,
If i assign a value to a string, is it possible to go and see where it is stored in the memory and what the value is?
e.g.
string _testString = "Value I want to read from memory";
Any way to do this?
|
|
|
|
|
diePopster wrote: see where it is stored in the memory
Why?
only two letters away from being an asset
|
|
|
|
|
Yes, but it is not recommended. If you have a requirement to do this you should really be using C++.
This is a quickie example of manipulating a string by getting it's pointer (char*)
string text = "Test";
unsafe
{
fixed (char* textPointer = text)
{
char* pointer = textPointer;
*pointer = Char.ToLower(*pointer);
*++pointer = Char.ToUpper(*pointer);
*++pointer = Char.ToUpper(*pointer);
*++pointer = Char.ToUpper(*pointer);
}
}
|
|
|
|
|
On top of everything else that's been said, using managed code, C#, VB.NET, or any other language that targets the .NET Framework, an item can be moved in memory by the Garbage Collector at any time. So, even though you got the pointer to item, you really cannot use the pointer because the item might not be there anymore. The pointer you have will NOT get updated to reflect the new location in memory.
However, there is a way aroudn that. It's called "pinning". The GC can be told to pin an object in memory so it can't be moved. Read up on it here[^]. Be careful. When you pin an object, you are also responsible for removing the pin when you're done with it.
|
|
|
|
|
I cannot find the file NET60.sis file in the net60 dir after installation.
please what went wrong.
thanks
|
|
|
|