I am creating an app that will be used with terminal services, and I have created a explorer that will allow me to transfer files. this is first of all only on local machine. Is there a way that will allow me to connect to the remote machine access their common library. that would allow them to choose desktop and Documents folders.
I have been trying to get the IP address of the remote machine by Code Projects Grabbing Information Of Terminal Services. I guess I'm really at a loss of words here, I'm not sure where to begin to start this process. any help or Ideas links would be very helpful.
Thanks so much!
Where is your file? In the net folder, or not? Can you install serviceses on target machine?
You can use Process.Start method in combination with Mark Russinovich utilities or powershell remoting.
Related
I write small apps to help automate daily work of some colleagues and want to put on a shared folder on my machine so that others from local network can execute when my computer is on. I don't have the luxury of my own server so this is the best I can do.
One of which is a Winform app that connects to an Oracle database via an Oracle client and Oracle Data Access installed on MY machine to retrieve information. I would hope that people can execute the app (.exe file) when my machine is on, without installing anything on their machine. The app will write to an output file (.html) on the same folder and open it on THEIR browser.
My question is : What should I do to make it possible ? How can people run this .exe file using Oracle Client, Oracle DataAccess and .Net framework already installed on MY machine as if I am running it locally.
I mark all C# Assemblies (automatically added by Visual Studio) as Copy Local to True (Microsoft.CSharp.dll, System.Data.dll, System.dll, System.Data.DataSetExtensions.dll, System.Deployment.dll, System.Drawing.dll, System.Net.Http.dll, System.Windows.Forms.dll, System.Xml.dll, System.Xml.Linq.dll). Would people still need .Net framework installed ? My app is quite simple with only one external dll Oracle.DataAccess.dll. How about Oracle client and Oracle Data Access.
Many thanks.
Best solution for your situation is create a webservice and make the clients that'll consume your webservice instead of them making direct calls to your database. It removes system dependencies and easier maintenance.
Your colleagues can go to your computer via remote desktop if it is feasible. In the probable case that this is not feasible, you need to decide what the colleagues will see. If they only need to see the generated html and they only need to trigger the execution of your exe, then you will need to have a program which listens to a port and make sure that the given port is requested correctly by your colleagues via a small client app.
But honestly, the use-case you describe sounds like a website used by your colleagues. You can create a website in .NET, the exe you have would be the controller or code-behind depending on the approach you use and the HTML would be the response. Then the colleagues will just request your page with the port you are listening at.
We are trying to pass commands or shell scripts execution to Linux server from ASP.net.
For example, if we pass command ls from ASP.NET to Linux server, then it must provide a list of files present in the respective path to ASP.NET as output.
Can anyone share the idea how we can achieve this?
telnet and other remote shell protocols are there for this.
Note: without proper security considerations it is very dangerous idea.
If you only need to access to the file system, consider using Samba. You can mount the remote file system to the Windows machine.
Another possibility is to access the files through FTP.
I need to develop an app in C# that is like the Restore Database at SQL Management Studio.
It's basically a FileDialog that remotely shows the files/folder on the server.
I think its pretty simple, but since I'm starting developing apps using Remote (.NET) I need some help.
Of course I'm not asking to have a ready-to-go code, I would appreciate some tutorials and how to start developing things remotely and using Windows Form.
Thanks !
Leo
That depends on the network access you're going to have to the remote machine. If you have access to the file system, all you need to do is point the regular file dialog to the right network path.
If you can't reach the remote machine's file system, you'll need to create an agent that runs on that machine and offers access to the files. You can do that, but unless you're really careful you're going to introduce a major security hole. Instead, you can just enable the regular Windows network file access.
If my .NET client uses System.IO.File.Copy to copy a file from \server1\share1\file1.txt to \sever1\share2\file2.txt, the file's data get read down to the client and then written back up to the server.
Is there an easy way to speed up things a bit by putting a process on the network-machine that realy does the copying?
I dont look for advice on programming such a service. I would rather find the tool or windows-functionality that already does this.
This sounds like a job for telnet or ssh, but these can be a pain to set up. I recommend you look at PsExec from microsoft which allows you to execute programs on a remote machine. You could simply use the copy program found in system32 through PsExec.
There is no need to create your own program to do this, just use the command line tools found on the target machine.
Almost certainly. I can think of a couple basic ways to do it:
Create a simple console applicaton that takes the source and destination paths/filenames, and performs a File.Copy(). Place it on the remote machine in a known location. Then invoke the process on the remote machine using PsExec. Your client app must be running in full trust in order to invoke a process programmatically, and the user running the app must have permission to run programs on the remote server.
Create a simple web method that again takes the source and destination and performs the copy. This requires setting up IIS on the network server with the requisite permissions to perform file access outside of the IIS "sandbox". However, it requires fewer client code permissions.
FYI CopyFileEx already does this if your client and server are Vista and later. So, not point in duplicating any of that effort in that case.
-scott
how can i command to run file.exe file from another computer in my domain with C#
I know System.Diagnostic.Process.Start but its starting in my computer.
How can i use it for "192.168.100.2" ip addressed computer for running an exe file from my comp with a command? I know TCP/Socket programming but else ?
PsExec, a part of PsTools, can do this for you.
If you don't need a UI for the .exe you can use WMI to start a process remotely. I haven't got code to do it here but this codeproject article looks like it would work.
one easy way is to have the remote computer listening to some kind of event, this could be message queues, remoting(port listening) , web services/http.
once it listen to the event the host computer will need to start the process itself, this will ensure security in the host computer since it will run under some local credentials and policies.
You may Share a folder containing the .exe on your computer within the domain and use telnet to get a command line on the other computer to run the program. Nothing specific to C#/.NET however.