Solved

Want to Automatically Connect to Internet through Proxy

Posted on 2002-03-07
11
191 Views
Last Modified: 2010-05-02
Hi Experts,

i had a problem before , i asked this problem to experts under "Want to automatically download a file from the net" at a specitic site "not direct site" and Ark answered this question by a "MAGIC" Code, the problem now is that i tesed this sotware in my home "using normal internet connection "through Dial up networking and TCP/IP " i made code to connect and test connection and download file based on this internet acces protocol. but the problem now is that this software will work on a Proxy server "leezed line", so does my code work or not, and if not , how to write code to perform the following on proxy server,
1- How to Test connection to the net
2- How to automatically connect to the net through proxy
NB. in this proxy, it is on Windows NT, to enter the net, i click the inernet explorer, a message box require authentication ID (username and password). so what is the code to automatically connect to the net through a proxy server and go to a specific site eg www.yahoo.com

the code that Ark made for me to automatically connect to the net  and download this data files is this :--
------------------------------------------------------

------------------------------------------------------

From: Ark  Points: 70  
Hello
I thought that my previous code works for you :(
As I mentioned earlier, progreess bar almost impossible (BTW, why do you need progress bar if you want
to start it from sheduler?) - this process doesn't control by application. First page send request to
server's executable and the server process this request, so we donno progress (and it's about 90% of
time).

Cheers
PS. For other Experts - here is my previous code:
(DAOXXX and Microsoft Internet Controls referenses required)

Dim sCaption As String

Public Function SaveRSCatalog(ByVal sFileName As String, Optional sFieldSeparator As String = ",") As
Boolean
'  On Error Resume Next
 Set ie = New InternetExplorer
'  Dim wnd As New SHDocVw.ShellWindows
'  Set ie = wnd(2): GoTo cont
 ie.Navigate "http://www.usp.org/cgi-bin/refstd/SoftCart.exe/refstd/frameset.htm?E+refstd"
'===Remove following string to make process invisible===
 ie.Visible = True
'=====Just for viewing progress======
 sCaption = "Connecting to main page...."
 Caption = sCaption
'====================================
 While ie.ReadyState < 4
    DoEvents
 Wend
 sCaption = "Downloading catalog......"
 Caption = sCaption
 Me.Print "Be patient, downloading of 70K can take few minutes"
 ie.Document.frames("USPbody").Document.All("Submit")(1).Click
 While ie.Busy
    DoEvents
 Wend
 While ie.ReadyState < 4
    DoEvents
 Wend
 sCaption = "Saving to " & sFileName & "..."
 Caption = sCaption
cont:
 Dim i As Integer, nCells As Long
 Dim nRow As Integer, nCol As Integer
'===Create New *mdb file=======
 If Dir(sFileName) <> "" Then Kill sFileName
 Dim dbsNew As Database
 Dim tbDef As TableDef
 Dim rs As Recordset
 Set dbsNew = DBEngine.Workspaces(0).CreateDatabase(sFileName, dbLangGeneral)
 Set tbDef = dbsNew.CreateTableDef("Catalog")
 With tbDef
     .Fields.Append .CreateField("Cat_No", dbText)
     .Fields.Append .CreateField("Cost", dbText)
     .Fields.Append .CreateField("Prev_Lot", dbText)
     .Fields.Append .CreateField("Current_Lot", dbText)
     .Fields.Append .CreateField("Description", dbMemo)
 End With
 For Each fld In tbDef.Fields
     fld.AllowZeroLength = True
 Next
 dbsNew.TableDefs.Append tbDef
 Set rs = tbDef.OpenRecordset
'======Saving data===============
 For Each d In ie.Document.frames("USPbody").Document.All
     If TypeName(d) = "HTMLTable" Then
        If i = 1 Then
            nCells = d.cells.length
            For nRow = 2 To nCells / 5
                rs.AddNew
                cellnum = (nRow - 1) * 5
                rs!Cat_No = Left(d.cells(cellnum + 1).innerText, 6)
                rs!Cost = Mid(d.cells(cellnum + 1).innerText, 9)
                rs!Prev_Lot = d.cells(cellnum + 2).innerText
                rs!Current_Lot = d.cells(cellnum + 3).innerText
                rs!Description = d.cells(cellnum + 4).innerText
                rs.Update
                rs.Bookmark = rs.LastModified
                Caption = sCaption & CInt(cellnum * 100 / nCells) & "% done"
            Next nRow
            Exit For
        End If
        i = i + 1
     End If
 Next
 Caption = "Done!"
 Set ie = Nothing
 SaveRSCatalog = (FileLen(sFileName) > 0)
 rs.Close: Set rs = Nothing
 Set tbDef = Nothing
 dbsNew.Close: Set dbsNew = Nothing
End Function

Private Sub Command1_Click()
 SaveRSCatalog "test.mdb"
End Sub

Private Sub ie_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
 If ProgressMax > 0 Then Caption = sCaption & CInt(Progress * 100 / ProgressMax) & "% done"
End Sub

 
------------------------------------------------------

------------------------------------------------------

thank u so much for ur interest,
Best Regards,
Dr.Waleed Said Abul Makarem
0
Comment
Question by:waleed_makarem
  • 4
  • 4
  • 2
11 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
If your configuration is setted with proxy, everything should works fine.If not you could use some api stuff to get connected and after that launch previous code from Ark.
0
 

Author Comment

by:waleed_makarem
Comment Utility
hi,
i think that this may be ok but which api code i use??

also , if u read Ark's code, u will find that he uses INVISIBLE Internet explorer . but when i open new internet explorer window in windows NT, a messagebox requires the user id and password "Authentication" . that is mean that when the software simulate this process , ie , the software must pass the user id and password in order to avoid error message,
Do u get me ?
so what is the code that i can use to pass the user id and password programatically so that the proxy will not require authenticatin ID

thanks for ur interest,
Best Regards,
Dr.Saleed Said abul makarem
0
 

Author Comment

by:waleed_makarem
Comment Utility
hi Richie,
what did u mean by ur proxy configurations are setted ?
i really do not know ANYtHING in proxy and networks ut what i know about this proxy is :--

1- when i open a new inernet explorer window, a message box require the id and password

2- it is better NOT to make any proxy setting changes that will affects its security,as the comp. i work in is multinational and i want the software not to conflict or cause any problems with the proxy,

3- any inforamtion u want on this proxy, i can ask the IT engineers in the comp.

thak u again for u help,
Dr.waleed said abul makarem
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
I mean, if by default, you internet config uses proxy, there is no problem at all.
Maybe i misunderstood something.
0
 

Author Comment

by:waleed_makarem
Comment Utility
hi Experts,

so , how can i programatically pass the user id and password to the proxy to get authentication to enter the the internet

thanks
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
I thinks it depends upon how proxy security is implemented.
You could try with InternetConnect API but i guess that username and passw parameter are for server at the end of the line not the proxy.
0
 

Author Comment

by:waleed_makarem
Comment Utility
hi richie,

i really do not understand,
can i use this software at proxy without passing the user id and passowrd "i doubt"
and if not , which code to use to pass this user id and password ? by api ,. how ?

regards,
Dr. waleed said abul makarem
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 60 total points
Comment Utility
Take a look at this thread:
http://www.experts-exchange.com/visualbasic/Q.20299072.html
The last post from asker could do the trick.
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20259830.html
http://www.experts-exchange.com/questions/Q.20259926.html
http://www.experts-exchange.com/questions/Q.20260910.html
http://www.experts-exchange.com/questions/Q.20270451.html
http://www.experts-exchange.com/questions/Q.20274708.html
http://www.experts-exchange.com/questions/Q.20274719.html
http://www.experts-exchange.com/questions/Q.20276685.html
http://www.experts-exchange.com/questions/Q.20294056.html
http://www.experts-exchange.com/questions/Q.20299738.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
Finalized by Moondancer - EE Moderator
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now