• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Makro ile Adres çubuğundan bu foruma login

snx111

Banned
Katılım
10 Ağustos 2010
Mesajlar
789
Excel Vers. ve Dili
2010 office tr
makro ile kullanacagım için bu konuya açtım;

excel.web.tr sitesine adres çubugundan login olmak için webbrowser1.navigate nin url kısmına hangi kodu yazmam gerekiyor?

gereken url tipi "www.excel.web.tr/login.php?do=login&vb_login_username=Snx111&vb_login_password=******" tarzında bir kod
 
Ekli kodlar işinize yararmı web ile ilgili pek bilgi sahibi değilim ama:

Kod:
Sub Excel_web()
On Error Resume Next
Set IE = CreateObject("internetexplorer.application")
IE.navigate ("http://www.excel.web.tr/")
IE.Visible = True


Do While IE.readystate <> 4: Loop
IE.document.forms(0).Item(0).innertext = Range("A6").Value
IE.document.forms(0).Item(2).innertext = Range("A7").Value
IE.document.forms(0).Item(3).Click
Set IE = Nothing
End Sub
 
click işlemi yapmak istemiyorum olay orda zaten sayın hüseyinkis ; post data ile siteye login olmak istiyorum .
sitedeki formu doldurarak değilde ; get post mantıgıyla ....
 
Kod:
Sub GetTable()

Dim xml As Object ' MSXML2.XMLHTTP60
Dim htmlDoc As Object ' MSHTML.HTMLDocument
Dim htmlBody As Object ' MSHTML.HTMLBody
Dim ieTable As Object
Dim clip As DataObject

Set xml = GetMSXML

With xml
      .Open "POST", "http://excel.web.tr/"
     'sayfa1.WebBrowser1.Navigate "http://excel.web.tr"
      .send "vb_login_username=******&vb_login_password=******"
End With
End sub......

Devamı mevcut. Ama login kısmı gerçekleşmiyor; bu türde bir kodu arşivinde olan var mı ?
 
Kod:
Dim myHttpWebRequest As HttpWebRequest = _

CType(WebRequest.Create("http://www.localhost/test.asp"), HttpWebRequest)

myHttpWebRequest.Method = "POST"

Dim inputData As String = "Your Data that will sent"

Dim XmlStream As New StreamReader(inputData )

Dim inputData As String = XmlStream.ReadToEnd

Dim postData As String = "Data" + ChrW(61) + inputData

Dim encoding As New ASCIIEncoding

Dim byte1 As Byte() = encoding.GetBytes(postData)

' Set the content type of the data being posted.

myHttpWebRequest.ContentType = "application/x-www-form-urlencoded"

' Set the content length of the string being posted.

myHttpWebRequest.ContentLength = postData.Length

Dim newStream As Stream = myHttpWebRequest.GetRequestStream()

newStream.Write(byte1, 0, byte1.Length)

newStream.Close()

Dim HttpWResp As HttpWebResponse = _

CType(myHttpWebRequest.GetResponse(), HttpWebResponse)

' Insert code that uses the response object.

Dim s As New StreamReader(HttpWResp.GetResponseStream)

MessageBox.Show(s.ReadToEnd)

HttpWResp.Close()

Catch ex As WebException

MessageBox.Show(ex.Message)

End Try



and the asp page contain one line is
<%
response.write request.form("Data")
%>


bu kodları bir siteden buldum ama vba penceresine yapıştırdıgımda hata veriyor 2010 office kullanıyorum vba nın versiyon farkımı var ? neden komut olarak görmüyor ?
 
Geri
Üst