Sockets checking if a file exists
-
Hey all, I was wondering if there was a way to use sockets to check if a file exists on the remote machine, and if it exists, read the data from the file and store it into another file on the connecting machine. I'm new to sockets and i have never done anything with them, but if someone could help me or tell me if this is even the right direction to go with what i'm trying to do, I would greatly appreciate it. Thanks everyone, ccotton333
-
i have tried this and it won't work because oa a blank password issue does anyone know how i could resolve this here is my code: Try Dim sinfo As System.Diagnostics.ProcessStartInfo sinfo.Arguments = "use z: \\server1\alarms /user:Administrator " sinfo.FileName = "c:\windows\system32\net.exe" System.Diagnostics.Process.Start(sinfo) Catch MsgBox("the mapping didn't work") End Try thanks for all your help, ccotton333
If the machines your using for this are in the same domain, this wouldn't be necessary as each machine in the domain shares the same trusted accounts and tokens. Since it is asking for a password, I take it the machines are in workgroup mode. This means that each machine maintains its own accounts and doesn't trust accounts and tokens from any other machine. You need to supply a valid account and password for the machine that your trying to map a drive to. You might have to fiddle with this to get it to work, but your command line should be something more like:
NET USE Z: \\machineName\shareName myPassword /USER:machineName\Administrator
Try typeing it at a command line first. Get it to work there, ther you can move what works for you into your code. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Hey all, I was wondering if there was a way to use sockets to check if a file exists on the remote machine, and if it exists, read the data from the file and store it into another file on the connecting machine. I'm new to sockets and i have never done anything with them, but if someone could help me or tell me if this is even the right direction to go with what i'm trying to do, I would greatly appreciate it. Thanks everyone, ccotton333
i have tried this and it won't work because oa a blank password issue does anyone know how i could resolve this here is my code: Try Dim sinfo As System.Diagnostics.ProcessStartInfo sinfo.Arguments = "use z: \\server1\alarms /user:Administrator " sinfo.FileName = "c:\windows\system32\net.exe" System.Diagnostics.Process.Start(sinfo) Catch MsgBox("the mapping didn't work") End Try thanks for all your help, ccotton333
-
Hey all, I was wondering if there was a way to use sockets to check if a file exists on the remote machine, and if it exists, read the data from the file and store it into another file on the connecting machine. I'm new to sockets and i have never done anything with them, but if someone could help me or tell me if this is even the right direction to go with what i'm trying to do, I would greatly appreciate it. Thanks everyone, ccotton333
There is not way to do this using sockets unless you write a server application that will listen for requests and carry out what you want. You also have to write the client side application to actually make the request, obviously. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
There is not way to do this using sockets unless you write a server application that will listen for requests and carry out what you want. You also have to write the client side application to actually make the request, obviously. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks for your response. Well i do have a web server side and a SQL server side and the problem is that the SQL server can't reach the internet and i'm trying to figure out how to send a email out to me to alert me when a certain process occurs and i can map a drive and both sides work or i can try to view the directory of the alarm path and i supply a username and password and it works great. but when i log off the program can't reach the SQL server from the Web Server and i need to be able to access the SQL server. If you could give me any advice on how to go about this i would appreciate it. Thanks ccotton333
-
Thanks for your response. Well i do have a web server side and a SQL server side and the problem is that the SQL server can't reach the internet and i'm trying to figure out how to send a email out to me to alert me when a certain process occurs and i can map a drive and both sides work or i can try to view the directory of the alarm path and i supply a username and password and it works great. but when i log off the program can't reach the SQL server from the Web Server and i need to be able to access the SQL server. If you could give me any advice on how to go about this i would appreciate it. Thanks ccotton333
What you said didn't make ANY sense what-so-ever. Try focusing on one topic, it'll be much easier to understand you. ccotton333 wrote: Well i do have a web server side and a SQL server side and the problem is that the SQL server can't reach the internet Are you saying that you have two machines, one IIS and one SQL? Are you saying that you can't see the SQL server from a machine on the Internet? ccotton333 wrote: and i'm trying to figure out how to send a email out to me to alert me when a certain process occurs It's easy enough to send email. Check into the
System.Web.Mail
namespace. What process that occurs to trigger this depends, well, on what you're monitoring for. ccotton333 wrote: i can map a drive and both sides work What? What sides? What do you mean by work? ccotton333 wrote: i can try to view the directory of the alarm path and i supply a username and password and it works great. I have no idea what you're talking about here. ccotton333 wrote: when i log off the program can't reach the SQL server from the Web Server I take it you have an IIS server on one machine and an SQL server on another machine. What program? Log off? What are you talking about? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
ok basically i have IIS on the webserver and then i have a private network between the SQL server and webserver. the LAN is also on another private lan an and all pcs on that lan can access the internet. so i have this SQL server that cannot reach the internet and i have written two programs one to run on the SQL server and one to run on the webserver that check on the SQL server for the alarm messages. when i am working on the webserver and have established a connection between it and the SQL server(i.e. connect using remote desktop or through the run dialog and enter in the username and password) i can run each program on the machines and they run great but when i set it up to run as a service. it seems to lose the connection between the two servers and doesn't run as it should. any ideas as to what i'm doin wrong? Thanks, ccotton333
That's better! It's perfectly understandable now! See what happens when you slow down, take a deep breath, and use puncuation? The problem you have is the account that your service is running under on the IIS machine. By default, this is the LocalSystem account, which only has rights to, obviously, the local machine. It doesn't have any rights to network resources since the account is local to the IIS machine. Now, what you have to do is run your service under an account, just like any other user account, that has the appropriate rights it needs to the IIS box AND, to make this easier, because these two machines are not in the same domain, this exact same account and password must also exist on the SQL box. Right-click "My Computer", pick Manage, then open Services and Applications in the left pane, then click on Services. Find your service in the right pane, right-click it and pick Properties. Click on the LogOn tab and you'll find where you can change the account that the service runs under. Oh yeah...create the account first, on BOTH machines. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
What you said didn't make ANY sense what-so-ever. Try focusing on one topic, it'll be much easier to understand you. ccotton333 wrote: Well i do have a web server side and a SQL server side and the problem is that the SQL server can't reach the internet Are you saying that you have two machines, one IIS and one SQL? Are you saying that you can't see the SQL server from a machine on the Internet? ccotton333 wrote: and i'm trying to figure out how to send a email out to me to alert me when a certain process occurs It's easy enough to send email. Check into the
System.Web.Mail
namespace. What process that occurs to trigger this depends, well, on what you're monitoring for. ccotton333 wrote: i can map a drive and both sides work What? What sides? What do you mean by work? ccotton333 wrote: i can try to view the directory of the alarm path and i supply a username and password and it works great. I have no idea what you're talking about here. ccotton333 wrote: when i log off the program can't reach the SQL server from the Web Server I take it you have an IIS server on one machine and an SQL server on another machine. What program? Log off? What are you talking about? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnomeok basically i have IIS on the webserver and then i have a private network between the SQL server and webserver. the LAN is also on another private lan an and all pcs on that lan can access the internet. so i have this SQL server that cannot reach the internet and i have written two programs one to run on the SQL server and one to run on the webserver that check on the SQL server for the alarm messages. when i am working on the webserver and have established a connection between it and the SQL server(i.e. connect using remote desktop or through the run dialog and enter in the username and password) i can run each program on the machines and they run great but when i set it up to run as a service. it seems to lose the connection between the two servers and doesn't run as it should. any ideas as to what i'm doin wrong? Thanks, ccotton333