Brocade Virtual ADX XML API Programmer’s Guide (Supporting Manual do Utilizador Página 874

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 878
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 873
864 Brocade Virtual ADX XML API Programmer’s Guide
53-1003248-01
Example: Unbinding a real server from a VIP
B
// Name: OpenRCloseLog
//
// Description: This function will be called to open or close the log file.
//
// Parameters: bOpen - true/false
//
/////////////////////////////////////////////////////////////////////////////
public bool OpenRCloseLog(bool bOpen)
{
string sLogPath = "";
//get the full location of the assembly with DaoTests in it
string sfullPath =
System.Reflection.Assembly.GetAssembly(typeof(Utils)).Location;
//get the folder that's in
string sDirectory = Path.GetDirectoryName(sfullPath);
sLogPath = String.Format("{0}\\ConfigureSLB.txt", sDirectory);
//check whether m_StreamWriter object is null before opening the log
file
if (bOpen == true && m_StreamWriter == null)
{
m_FileStream = new FileStream(sLogPath, FileMode.OpenOrCreate |
FileMode.Append, FileAccess.Write);
m_StreamWriter = new StreamWriter(m_FileStream);
if (m_StreamWriter == null)
{
return false;
}
return true;
}
else
{
//Check the validity of the streamwriter before calling close
command
if (m_StreamWriter != null)
{
//Close the log file
m_StreamWriter.Close();
m_FileStream.Close();
m_FileStream = null;
m_StreamWriter = null;
}
}
return true;
}
/////////////////////////////////////////////////////////////////////////////
// Name: WL
//
// Description: This function to write the log message to the file.
//
// Parameters: sLogMessage - the log message to be written to the log file.
//
/////////////////////////////////////////////////////////////////////////////
public void WL(string sLogMessage, string sLogMessage1)
{
if (m_StreamWriter == null)
{
//Do not write the log if the log file is not opened
Vista de página 873
1 2 ... 869 870 871 872 873 874 875 876 877 878

Comentários a estes Manuais

Sem comentários