NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.
Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.
1 to 4 of 4
FUNCTION GetSkypeDefaultAccount( void ) . . . cFileName := NTK_SHGetSpecialFolderPath(NULL, CSIDL_APPDATA, .F.) cFileName := cFileName + "\\Skype\\shared.xml" // This file holdes among other data, the default user ID IF !FILE(cFileName) cMsgResult := "Skype is not installed on this machine." RETURN(cMsgResult) ENDIF . . .
. . . // Load the content of shared.xml into a memory var string cString := MEMOREAD( cFileName ) IF !( LEN(cString) > 0 ) cMsgResult := "XML content unavailable - File: "+CRLF+cFileName+CRLF+; "Skype is probably not installed on this machine." RETURN(cMsgResult) ENDIF // Remove invalid chars in tag names, if any cString := STRTRAN( cString, "<_", "[_" ) // avoid error #4: 'Invalid character as tag name' cString := STRTRAN( cString, "</_", "[/_" ) // avoid error #4: 'Invalid character as tag name' . . .
. . . // Create an XML memory object oXmlDoc := TXmlDocument():New( cString ) IF !( oXmlDoc:nError==HBXML_ERROR_NONE ) cMsgResult := "XML file parsing error #"+AllTrim(str(oXmlDoc:nError))+": "+HB_XmlErrorDesc(oXmlDoc:nError) RETURN(cMsgResult) ENDIF // Parse the XML document till the <Account> node is found oXmlNode := oXmlDoc:findFirst( "Account" ) IF oXmlNode <> NIL // If found, we look for the existence if a nested node called: <Default>. oXmlSubNode := oXmlNode:nextInTree() // Go to Next node If oXmlSubNode:cName=="Default" cMsgResult := "DEFAULT ACCOUNT NAME FOUND!"+CRLF+; "The Skype's Default Account Name is:"+CRLF+"["+oXmlSubNode:cData+"]" EndIf ENDIF . . .
<?xml version="1.0"?> <config version="1.0" serial="42" timestamp="1489748553.11"> <Lib> <Access> <Cookies>4100</Cookies> <Enabled>1</Enabled> </Access> <Account> <Default>myaccountname</Default> <UpgradeHints>0/6.18.*.*,4</UpgradeHints> </Account> <BCM> <_2>000010008844E7...... ect. </BCM> . . .
FUNCTION GetSkypeAccountList( void ) Local nI Local aSkypeAccList Local cMsgResult := "" // Get Skype's list of registered accounts, if any aSkypeAccList := __GetSkypeAccountList() IF !EMPTY(aSkypeAccList) cMsgResult += "Skype's list of registered accounts:"+CRLF cMsgResult += "------------------------------------"+CRLF FOR nI := 1 TO LEN(aSkypeAccList) cMsgResult += "["+ aSkypeAccList[nI] +"]"+CRLF NEXT cMsgResult += CRLF+CRLF // Skip two lines ENDIF RETURN(cMsgResult)
+1 Ab.
Thanks for the work done and for the time devoted to these step-by-step explanations.
- Chris
I just have a question:
Where could I find documention on xml objects used in your code?
1 to 4 of 4