Solved

How to using server.URLEncode at visual basic 6.0

Posted on 2001-06-02
9
1,338 Views
Last Modified: 2013-11-25
hi
How to using server.URLEncode at visual basic 6.0

thank
0
Comment
Question by:kwq5421
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 6

Expert Comment

by:sharmon
Comment Utility
If you are making a IIS application it should already be available to you.  If not you may want to look at this function that someone has already written, that will do it for you.  Here is the link...

http://www.planet-source-code.com/xq/ASP/txtCodeId.3229/lngWId.1/qx/vb/scripts/ShowCode.htm
0
 
LVL 1

Author Comment

by:kwq5421
Comment Utility
Can i using the vbscript server.urlencode at vb source code ? thank ..
0
 
LVL 1

Author Comment

by:kwq5421
Comment Utility
Can i using the vbscript server.urlencode at vb source code ? thank ..
0
 
LVL 1

Author Comment

by:kwq5421
Comment Utility
Can i using the vbscript server.urlencode at vb source code ? thank ..
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Expert Comment

by:jdunck
Comment Utility
Server.URLEncode is not part of VBScript.

The Server object is part of ASP...-not- part of VB.

Understand that methods of objects are part of that object, -not- part of the language you happen to be programming in.

ASP can be written in JavaScript just as easily, and COM objects can be used by any language that supports COM (C++, VC++, VB, Java, I think).
0
 
LVL 6

Accepted Solution

by:
sharmon earned 15 total points
Comment Utility
Add a reference to Microsoft ASP library in your project and it will expose Server, Session, etc...but they will not work unless they are passed from a real Session on a IIS server into your project.  You cannot set them to new objects.  I do not know the reasoning behind it as I have never looked into it.  I haven't ever had a need to use the ASP object library without a IIS Server.  
0
 
LVL 6

Expert Comment

by:andyclap
Comment Utility
It's not actually a very difficult function, you could write your own along the lines of:

Public Function URLEncode(ByVal s As String) As String

    Dim lLoop As Long
    Dim sC As String

    URLEncode = ""
    For lLoop = 1 To Len(s)
        sC = Mid$(s, lLoop, 1)
        If InStr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", UCase$(sC)) = 0 Then
            If Asc(sC) < 16 Then
                sC = "%0" & Hex$(Asc(sC))
            Else
                sC = "%" & Hex$(Asc(sC))
            End If
        End If
       
        URLEncode = URLEncode & sC
    Next
   
End Function
0
 
LVL 1

Expert Comment

by:jdunck
Comment Utility
AndyClap --
  Its true that the specs aren't hard to handle, but since the original question was so far off the mark, I was trying to explain what he was really asking.
  Trying to use an ASP-created object as an intrinic property of VB begs for clarification.
0
 
LVL 6

Expert Comment

by:sharmon
Comment Utility
If you didn't like the responses you had gotten from us so far, you should have requested a deletion of the question or held out for whatever you were looking for.  This is the third time someone I responded who couldn't do what they were asking for and I told them that, and gotten a grade of C for it.  I would have rather not helped you at all.  I don't think I'll be responding to questions that do not have a valid answer anymore.  There were two answers to this, one You Cant Include the ASP Object Library in a VB Stand Alone Application, or write your own replacement function.  You have gotten both of them from me, and another from Andy.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

11 Experts available now in Live!

Get 1:1 Help Now