% @Language=VbScript%> <% Option Explicit %> <% '---------------------------------------------------------------------------- ' nicwins_prop.asp: display and update the WINS properties of NIC. ' Description: this page displays the wins server properties of NIC and ' allows to change the properties ' Copyright (c) Microsoft Corporation. All rights reserved. ' ' Date Description ' 16-Jan-01 Creation date ' 09-Mar-01 Modified date '----------------------------------------------------------------------------- %> <% '------------------------------------------------------------------------- ' Global Variables '------------------------------------------------------------------------- Dim G_objService 'Object to SWBEM service Dim page 'Variable that receives the output page object when 'creating a page Dim rc 'Return value for CreatePage Dim SOURCE_FILE 'To hold source file name SOURCE_FILE = SA_GetScriptFileName() '------------------------------------------------------------------------- ' Global Form Variables '------------------------------------------------------------------------- Dim F_strNWadapter 'NIC adapter description Dim F_nNWadapterindex 'NIC adapter index Dim F_strWinservers 'Contains #-seperated list of WINS servers Dim F_radSelected 'Which option is selected ' "1" means DHCP enabled ' "2" means Manual Settings 'Create property page rc=SA_CreatePage(L_WINSTASKTITLE_TEXT,"",PT_PROPERTY,page) 'Serve the page If(rc=0) then SA_ShowPage(Page) End if '------------------------------------------------------------------------- 'Function: OnInitPage() 'Description: Called to signal first time processing for this page. ' Use this method to do first time initialization tasks 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnInitPage(ByRef PageIn,ByRef EventArg) Call SA_TraceOut(SOURCE_FILE,"OnInitPage") 'gets the default values of the wins server OnInitPage = GetDefaultValues() End Function '------------------------------------------------------------------------- 'Function: OnServePropertyPage() 'Description: Called when the page needs to be served.Use this ' method to serve content 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnServePropertyPage(ByRef PageIn,Byref EventArg) Call SA_TraceOut( SOURCE_FILE, "OnServePropertyPage") Call ServeCommonJavaScript() 'serves the html content Call ServePage() OnServePropertyPage = True End Function '------------------------------------------------------------------------- 'Function: OnPostBackPage() 'Description: Called to signal that the page has been posted-back. 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnPostBackPage(ByRef PageIn ,ByRef EventArg) Call SA_TraceOut( SOURCE_FILE, "OnPostBackPage") 'To get the value of NIC adapter index value after form is submitted F_nNWadapterindex = Request.Form("hdnNWAdapterID") 'List of winsservers after form has been submitted F_strWinservers =Request.Form("hdnServerslist") ' The radio button to be selected - contains 1 or 2 only F_radSelected = Request.Form("hdnRadioSelected") OnPostBackPage = True End Function '------------------------------------------------------------------------- 'Function: OnSubmitPage() 'Description: Called when the page has been submitted for processing. ' Use this method to process the submit request. 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: In:G_objService-Getting WMI connection Object ' Out:F_nNWadapterindex-Getting NIC adapter Index ' Out:F_radSelected-Getting radio button selection ' Out:F_strWinservers-Getting new list wins servers ' L_(*)-Localization content '------------------------------------------------------------------------- Public Function OnSubmitPage(ByRef PageIn ,ByRef EventArg) Call SA_TraceOut( SOURCE_FILE, "OnSubmitPage") 'Getting WMI connection Object on error displays failure page Set G_objService=GetWMIConnection(CONST_WMI_WIN32_NAMESPACE) call GetWINSConfiguration(1) 'Updating the wins server settings If SetWINSserverConfiguration() Then OnSubmitPage = True Else OnSubmitPage = False End if 'Release the object set G_objService = nothing End Function '------------------------------------------------------------------------- 'Function: OnClosePage() 'Description: Called when the page is about closed.Use this method ' to perform clean-up processing 'Input Variables: PageIn,EventArg 'Output Variables: PageIn,EventArg 'Returns: True/False 'Global Variables: None '------------------------------------------------------------------------- Public Function OnClosePage(ByRef PageIn ,ByRef EventArg) Call SA_TraceOut( SOURCE_FILE, "OnClosePage") OnClosePage = TRUE End Function '------------------------------------------------------------------------- 'Function: ServeCommonJavaScript 'Description: Serves in initializing the values,setting the form ' data and validating the form values 'Input Variables: None 'Output Variables: None 'Returns: None 'Global Variables: None '------------------------------------------------------------------------- Function ServeCommonJavaScript() %> <% End Function '------------------------------------------------------------------------- ' Subroutine name: ServePage ' Description: Serves few Javascript functions and helps in ' displaying HTML of the page ' Input Variables: None. ' Output Variables: None ' Return Values: None. ' Global Variables: In:G_objService-Getting WMI connection Object ' Out:F_nNWadapterindex-Getting NIC adapter Index ' Out:F_radSelected-Getting radio button selection ' Out:F_strWinservers-Getting new list wins servers ' L_(*)-Localization content '------------------------------------------------------------------------- Sub ServePage() Err.CLear On Error Resume Next Dim objNetAdapter 'To hold network adapter object instance Dim strDHCPEnabled 'to hold the value Dhcp enabled or not Call SA_TraceOut( SOURCE_FILE, "ServePage()") ' Getting the Network adapter objects set objNetAdapter = getNetworkAdapterObject(G_objService,F_nNWadapterindex) If Err.number <>0 then Call SA_TraceOut( SOURCE_FILE, "Error in getting Network adapter Object-ServePage()") Call SA_ServeFailurePage(L_NIC_ADAPTERINSTANCEFAILED_ERRORMESSAGE) Exit Sub End If 'Get Whether the DHCP is enabled on the NIC. strDHCPEnabled = isDHCPenabled(objNetAdapter) %>
<%=GetNicName(F_nNWadapterindex)%> | |||
<%=L_CONFIGURATION_TEXT%> | onClick="EnableOK();HandleControls(true)"> <%=L_OBTAINIPFROMDHCP_TEXT%> | ||
onClick="EnableOK(); enableWINSControls();" > <%=L_NIC_IP_CONFIGUREMANUALLY%> | |||
<%=L_WINS_SERVER_ADDRESS_TEXT%> | |||
<%=L_WINSADDRESSES_TEXT%> |
<%
Call SA_ServeOnClickButtonEx(L_BUTTON_ADD_TEXT, "", "JavaScript:verifyIPaddress()", 60, 0, "DISABLED", "btnAddwinsserver")
%>
<% Call SA_ServeOnClickButtonEx(L_BUTTON_REMOVE_TEXT, "", "javaScript:removeIPFromWINSserverListbox()", 60, 0, "DISABLED", "btnRemovewinsserver") %> |