home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
ins.cab
/
nnbld.asp
< prev
next >
Wrap
Text File
|
1997-10-12
|
5KB
|
180 lines
<% Response.Expires = 0 %>
<% svr = Session("svr") %>
<% ServiceInstance = Session("ServiceInstance") %>
<% action = Request("action") %>
<% VSvrToDelete = Request("VSvrToDelete") %>
<% VServer = Request("VServer") %>
<% newState = Request("newState") %>
<% set nntpAdmin = Server.CreateObject("nntpadm.admin.1") %>
<html>
<head>
<script language="javascript">
<% if (action = "setState") then %>
var x = "<% = newState %>";
<% On Error Resume Next %>
<% set nntpVirtualServiceInstance = Server.CreateObject( "Nntpadm.virtualserver.1" ) %>
<% if (Err <> 0) then %>
alert("<% = Err.description %>");
<% end if %>
<%
On Error Resume Next
if (Session("svr") = "") then
nntpVirtualServiceInstance.Server = Request.ServerVariables("SERVER_NAME")
else
nntpVirtualServiceInstance.Server = Session("svr")
end if
if (Err <> 0) then
%>
alert("<% = Err.description %>");
<% end if %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.ServiceInstance = VServer %>
<% if (Err <> 0) then %>
alert("<% = Err.description %>");
<% end if %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.Get %>
<% if (Err <> 0) then %>
alert("<% = Err.description %>");
<% end if %>
<% if (newState = "2") then %>
<% REM Try to start the service - if an error is returned in the Win32ErrorCode %>
<% REM Convert it to a string and display it in an alert box %>
<% REM If no error occurs, update the tree control %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.Start %>
<% stateError = nntpVirtualServiceInstance.Win32ErrorCode %>
<% DisplayError = nntpAdmin.ErrorToString(stateError) %>
<% if (stateError <> 0) then %>
alert("<% = DisplayError %>");
<% else %>
var theList = top.head.cList;
var gVars = top.head.Global;
var sel = gVars.selId;
theList[sel].state = x;
top.body.list.location.href = top.body.list.location.href;
<% end if %>
<% end if %>
<% if (newState = "4") then %>
<% REM Try to stop the service - if an error is returned in the Win32ErrorCode %>
<% REM Convert it to a string and display it in an alert box %>
<% REM If no error occurs, update the tree control %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.Stop %>
<% stateError = nntpVirtualServiceInstance.Win32ErrorCode %>
<% DisplayError = nntpAdmin.ErrorToString(stateError) %>
<% if (stateError <> 0) then %>
alert("<% = DisplayError %>");
<% else %>
var theList = top.head.cList;
var gVars = top.head.Global;
var sel = gVars.selId;
theList[sel].state = x;
top.body.list.location.href = top.body.list.location.href;
<% end if %>
<% end if %>
<% if (newState = "0") then %>
<% REM Try to continue the service - if an error is returned in the Win32ErrorCode %>
<% REM Convert it to a string and display it in an alert box %>
<% REM If no error occurs, update the tree control %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.Continue %>
<% stateError = nntpVirtualServiceInstance.Win32ErrorCode %>
<% DisplayError = nntpAdmin.ErrorToString(stateError) %>
<% if (stateError <> 0) then %>
alert("<% = DisplayError %>");
<% else %>
var theList = top.head.cList;
var gVars = top.head.Global;
var sel = gVars.selId;
theList[sel].state = x;
top.body.list.location.href = top.body.list.location.href;
<% end if %>
<% end if %>
<% if (newState = "3") then %>
<% REM Try to pause the service - if an error is returned in the Win32ErrorCode %>
<% REM Convert it to a string and display it in an alert box %>
<% REM If no error occurs, update the tree control %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.Pause %>
<% stateError = nntpVirtualServiceInstance.Win32ErrorCode %>
<% DisplayError = nntpAdmin.ErrorToString(stateError) %>
<% if (stateError <> 0) then %>
alert("<% = DisplayError %>");
<% else %>
var theList = top.head.cList;
var gVars = top.head.Global;
var sel = gVars.selId;
theList[sel].state = x;
top.body.list.location.href = top.body.list.location.href;
<% end if %>
<% end if %>
<% On Error Resume Next %>
<% nntpVirtualServiceInstance.Set %>
<% if (Err <> 0) then %>
alert("<% = Err.description %>");
<% end if %>
<% end if %>
</script>
</head>
<body>
</body>
</html>