Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2012, 05:52 PM
JakeKoekemoer JakeKoekemoer is offline
Junior Member
 
Join Date: Jul 2011
Posts: 12
Unhappy Check for a Server Name

Hi, Okay this is what I need my application to do. For the computer to work it needs to connect to the server. But I cant find code to check if its connected to the server.

I create a network drive using the following code :


var
WshNetWork : Variant;



WshNetWork:=CreateOleObject('WScript.Network');
//create the network drive
WshNetwork.MapNetworkDrive('H:', '\\server\clientconnect');


Now when the server computer is not found I want the pc to shut down... problem is I can't find a code that will tell me if the server exists or if it doesnt... Someone Help
Reply With Quote
  #2  
Old 02-12-2012, 10:04 AM
JacquesKoekemoer JacquesKoekemoer is offline
Junior Member
 
Join Date: Feb 2012
Posts: 3
Default

Using Try and Catch :

Code:
Try
\\ do your stuff here
Except
showMessage('fail');
Application.Terminate;
Use the CallLastOSError or similar procedures to output the error to a file
Reply With Quote
  #3  
Old 02-18-2012, 02:48 PM
JStarks JStarks is offline
Junior Member
 
Join Date: Feb 2012
Location: United States
Posts: 7
Default Check for a Server Name

I can not locate INI file on my file system. What is the name of the file and where is usually the file stored please give me dir name?
Reply With Quote
  #4  
Old 02-18-2012, 03:11 PM
JacquesKoekemoer JacquesKoekemoer is offline
Junior Member
 
Join Date: Feb 2012
Posts: 3
Default

Quote:
Originally Posted by JStarks View Post
I can not locate INI file on my file system. What is the name of the file and where is usually the file stored please give me dir name?
What Ini file are you looking for ?
Reply With Quote
  #5  
Old 02-18-2012, 06:37 PM
JacquesKoekemoer JacquesKoekemoer is offline
Junior Member
 
Join Date: Feb 2012
Posts: 3
Default

Dude an INI file contains configuration data.
What INI file are you looking for.

Running W7 do this
Go to your system drive. Go to the search in the top right type *.ini*
And then you will see each file that is in the system drive with the ini word in it.

Search the same thing in wXP
Reply With Quote
Reply

Tags
drive, error, find server, network

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:08 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.