Tuesday, June 12, 2012

Bagaimana cara menjalankan Speech Properties Dialog - VB6

Karena Speech Properties dialog tidak terdapat dalam Windows\System32 maka untuk memanggilnya, Kita memerlukan kode di bawah:
Option Explicit 
 
Private Sub Command1_Click() 
    Shell "rundll32.exe shell32.dll,Control_RunDLL " & Chr(34) & "c:\program files\common files\microsoft shared\speech\sapi.cpl" & Chr(34) 
End Sub 
Perhatikan kode di atas, pathnya diapit oleh chr(34). Selain menggunakan chr(34) kita bisa juga menggunakan '"""' atau mengkonversi path menjadi format DOS 8.3 seperti yang telah ditulis terdahulu.
READ MORE - Bagaimana cara menjalankan Speech Properties Dialog - VB6

Monday, June 11, 2012

Twitter OAuth 1.0a: Digital Signature - Base String - VB6

Dalam Twitter OAuth 1.0, setiap kita melakukan request ke twitter.com maka tiap-tiap request harus disertai dengan digital signature sebagai bukti otentifikasi dan otorisasi. Adapun digital signature tersebut adalah hasil dari hash (one way encrypt):HMAC-SHA1 (BaseString + Key).Adapun Key adalah gabungan dari: (ConsumerSecret + AccessTokenSecret)

Nah disini saya menjelaskan bagaimana merakit/membuat BaseString untuk men-generate digital signature melalui VB6 seperti yang telah dijelaskan di atas:

Private Function GetTwitterBaseString() As String

Dim strURL As String
Dim strBaseString As String
strURL = "http://api.twitter.com/1/statuses/update.json"

strBaseString = txtMethod & _
"&" & UrlEncodeUtf8(txtURL.Text)
strQuery = HSA1.URLEncode("oauth_consumer_key=" & txtConsumerKey.Text) & _
UrlEncodeUtf8("&oauth_nonce=" & txtNonce.Text) & _
UrlEncodeUtf8("&oauth_signature_method=" & txtSignatureMethod.Text) & _
UrlEncodeUtf8("&oauth_timestamp=" & txtTimeStamp.Text) & _
UrlEncodeUtf8("&oauth_token=" & txtToken.Text) & _
UrlEncodeUtf8("&oauth_version=" & txtVersion.Text)
strParameter = HSA1.URLEncode("&status=" & UrlEncodeUtf8(strURL))
GetTwitterBaseString = strBaseString & "&" & strQuery & strParameter

End Function
Demikian BaseString Twitter OAuth 1.0 melalui VB6. Semoga bermanfaat. Apabila kita gagal mengirim tweet ke twitter menggunakan OAuth 1.0, mungkin bisa kita ganti dengan OhOut atau lebih tepatnya Oh Out Of Memory (OOM), mengenai artikel OOM bisa Anda baca di sini.
READ MORE - Twitter OAuth 1.0a: Digital Signature - Base String - VB6

Saturday, June 9, 2012

Daftar Google Data API Service Names

Google Analytics Data APIs => analytics
Google Apps APIs (Domain Information & Management) => apps
Google Sites Data API => jotspot
Blogger Data API => blogger
Book Search Data API => print
Calendar Data API => cl
Google Code Search Data API => codesearch
Contacts Data API => cp
Content API for Shopping => structuredcontent
Documents List Data API => writely
Finance Data API => finance
Gmail Atom feed => mail
Health Data API => health
weaver (H9 sandbox)
Maps Data APIs => local
Picasa Web Albums Data API => lh2
Sidewiki Data API => annotateweb
Spreadsheets Data API => wise
Webmaster Tools API => sitemaps
YouTube Data API => youtube
READ MORE - Daftar Google Data API Service Names

Merger 2 File XML Menggunakan Visual Basic 6.0

Private Sub AddPostNew(XMLSource As String, XMLDestination As String) 

Dim
strText As String
Dim
strPost As String

Dim
domFree As FreeThreadedDOMDocument60
Dim domApt As DOMDocument60
Dim node As IXMLDOMNode
Dim clone As IXMLDOMNode
Dim msg As String

msg = ""
Set domFree = New FreeThreadedDOMDocument60
Set domApt = New DOMDocument60

domApt.async = False
If False =
domApt.loadXML(XMLDestination) Then
MsgBox "can't load doc1.xml"
Exit Sub
End If

domFree.async = False
If False =
domFree.loadXML(XMLSource) Then
MsgBox "can't load doc2.xml"
Exit Sub
End If

Dim
nodeId As IXMLDOMAttribute
Set node = domFree.documentElement

Set
clone = domApt.importNode(node, True)

domApt.documentElement.appendChild clone
domApt.documentElement.appendChild domApt.createTextNode(vbNewLine)

Set
node = Nothing
Set clone = Nothing

domApt.save strPathXML

End Sub
READ MORE - Merger 2 File XML Menggunakan Visual Basic 6.0