![]() |
|
bikin browser sederhana - Printable Version +- HN-Community (https://hacker-newbie.org) +-- Forum: Miscellaneous (https://hacker-newbie.org/forum-86.html) +--- Forum: Coding/Programing (https://hacker-newbie.org/forum-19.html) +---- Forum: Visual Basic (VB) (https://hacker-newbie.org/forum-68.html) +---- Thread: bikin browser sederhana (/thread-6080.html) |
bikin browser sederhana - hogyz - 12-27-2010 alat siapin 1 form 1 module 8 common button 1 combo 1 webbrowser code nya ini Code: 'edited by ho1onk
'http://ho1onk.cz.cc
'http://ho1onk-crew.uk.cr
Public Function IsConnected() As Boolean
Dim TRasCon(255) As RASCONN95
Dim lg As Long
Dim lpcon As Long
Dim RetVal As Long
Dim Tstatus As RASCONNSTATUS95
'
TRasCon(0).dwSize = 412
lg = 256 * TRasCon(0).dwSize
'
RetVal = RasEnumConnections(TRasCon(0), lg, lpcon)
If RetVal <> 0 Then
MsgBox \"ERROR\"
Exit Function
End If
'
Tstatus.dwSize = 160
RetVal = RasGetConnectStatus(TRasCon(0).hRasCon, Tstatus)
If Tstatus.RasConnState = &H2000 Then
IsConnected = True
MsgBox \" You Are Connected To Internet Surf & Enjoy \", vbMsgBoxSetForeground
Else
IsConnected = False
MsgBox \" Sorry You Are Not Connected To Internet \", vbMsgBoxSetForeground
End If
End Function
Sub PercentBar(Shape As Control, Done As Variant, Total As Variant)
On Error Resume Next
Shape.AutoRedraw = True
Shape.FillStyle = 0
Shape.DrawStyle = 0
Shape.FontName = \"Fixedsys\"
Shape.FontSize = 8.25
Shape.FontBold = False
X = Done / Total * Shape.Width
Shape.Line (0, 0)-(Shape.Width, Shape.Height), &HC0C0C0, BF
Shape.Line (0, 0)-(X - 10, Shape.Height), &H800000, BF
Shape.CurrentX = (Shape.Width / 2) - 100
Shape.CurrentY = (Shape.Height / 2) - 125
Shape.ForeColor = RGB(0, 0, 0)
End Sub
Private Sub Command1_Click()
If Combo1.Text = \"\" Then
MsgBox (\"There Is No Page Avilable To Go Back\")
Else
WebBrowser1.GoBack
End If
End Sub
Private Sub Command2_Click()
If Combo1.Text = \"\" Then
MsgBox (\"There Is No Page Avilable To Go Forward\")
Else
WebBrowser1.GoBack
End If
End Sub
Private Sub Command3_Click()
WebBrowser1.Stop
End Sub
Private Sub Command4_Click()
WebBrowser1.Refresh
End Sub
Private Sub Command5_Click()
WebBrowser1.GoHome
End Sub
Private Sub Command6_Click()
WebBrowser1.GoSearch
End Sub
Private Sub Command7_Click()
Dim a
With CommonDialog1
.Filter = \"HTML Files (*.htm)|*.htm|HTML Files (*.html)| *.html\"
.ShowOpen
End With
a = CommonDialog1.FileName
Combo1.Text = a
Combo1.SetFocus
End Sub
Private Sub Command8_Click()
Call IsConnected
End Sub
Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
Label1.Caption = Text
End Sub
Private Sub WebBrowser1_TitleChange(ByVal Text As String)
Me.Caption = Text
End Sub
Private Sub WebBrowser1_BeforeNavigate(ByVal url As Variant, ByVal Cancel As Boolean)
Combo1.AddItem url
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
WebBrowser1.Navigate (Combo1.Text)
KeyAscii = 0
End If
End Submodule Code: Public Declare Function RasEnumConnections Lib \"RasApi32.dll\" Alias \"RasEnumConnectionsA\" (lpRasCon As Any, lpcb As Long, lpcConnections As Long) As Long
Public Declare Function RasGetConnectStatus Lib \"RasApi32.dll\" Alias \"RasGetConnectStatusA\" (ByVal hRasCon As Long, lpStatus As Any) As Long
'
Public Const RAS95_MaxEntryName = 256
Public Const RAS95_MaxDeviceType = 16
Public Const RAS95_MaxDeviceName = 32
'
Public Type RASCONN95
dwSize As Long
hRasCon As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
'
Public Type RASCONNSTATUS95
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type![]() semoga bermanfaat RE: bikin browser sederhana - Sidom - 12-27-2010 cara pakenya gmn bro RE: bikin browser sederhana - hogyz - 12-28-2010 sama kayk fire fox cuma yang ini hasil bikinan kita dan lebih ringan hehhe RE: bikin browser sederhana - Punish3rZ - 02-15-2011 Gan.. buat tutor bergambarnya dong Gan.. ane mau buat Browser nih..
RE: bikin browser sederhana - Boyz_scorpio - 02-15-2011 cara makenya gmna ya om...
RE: bikin browser sederhana - T-Blash - 02-16-2011 Ini Pake VB ???? RE: bikin browser sederhana - Marvellous - 02-16-2011 Code: Create a Very Simple Browser
#include <afxinet.h>
//assumes URL names have been initialized
CInternetSession session("My Session");
CStdioFile* pFile = NULL;
//use a URL and display a Web page
while (lpszURL = DisplayPage(...))
{
pFile = session.OpenURL(lpszURL);
while (pFile->Read(szBuff,1024) > 0)
{
//read file...
}
delete pFile;
}
session.Close();
Download a Web Page
//this code excerpt also demonstrates how to use //try/catch exception handling
#include <afxinet.h>
//assumes server, port and URL names have been initialized
CInternetSession session("My Session");
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
try
{
CString strServerName;
INTERNET_PORT nPort;
pServer = session.GetHttpConnection(strServerName, nPort);
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject);
pFile->AddRequestHeaders(szHeaders);
pFile->SendRequest();
pFile->QueryInfoStatusCode(dwRet);
if (dwRet == HTTP_STATUS_OK)
{
UINT nRead = pFile->Read(szBuff, 1023);
while (nRead > 0)
{
//read file...
}
}
delete pFile;
delete pServer;
}
catch (CInternetException* pEx)
{
//catch errors from WinInet
}
session.Close();
FTP a File
#include <afxinet.h>
//assumes server and file names have been initialized
CInternetSession session("My FTP Session");
CFtpConnection* pConn = NULL;
pConn = session.GetFtpConnection(lpszServerName);
//get the file
if (!pConn->GetFile(pstrRemoteFile, pstrLocalFile))
//display an error
delete pConn;
session.Close();
Retrieve a Gopher Directory
#include <afxinet.h>
//assumes file name has been initialized
CInternetSession session("My Gopher Session");
CGopherConnection* pConn = NULL;
CGopherFileFind* pFile;
pConn = session.GetGopherConnection("gopher.yoursite.com");
pFile = new CGopherFileFind(pConn);
BOOL bFound = pFile->FindFile(lpszFileToFind);
while (bFound)
{
bFound = pFile->FindNextFile();
//retrieve attributes of found file
}
delete pFile;
delete pConn;
session.Close();izin nyoret./.. RE: bikin browser sederhana - boledcool - 02-16-2011 aduh masih pusing. pake gambar donk kk RE: bikin browser sederhana - hogyz - 02-17-2011 (02-16-2011, 03:28 PM)boledcool Wrote: aduh masih pusing. ms gt doank kok mesti pake gambar?
RE: bikin browser sederhana - Obieaja - 02-17-2011 ini scrip di apain ya ?disimpan dalam bentuk apa ? |