PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

VB code for Zoom search on ASP.NET website

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VB code for Zoom search on ASP.NET website

    Could someone please post the VB code for this:
    http://www.wrensoft.com/zoom/support/aspdotnet.html

    Thanks much,
    TLW

  • #2
    See this page,
    http://www.wrensoft.com/zoom/support/faq_ssi.html

    Code:
    <%
    Dim WshShell, env
    Set WshShell = CreateObject&#40;"WScript.Shell"&#41;
    Set env = WshShell.Environment&#40;"Process"&#41;
    env.Item&#40;"REQUEST_METHOD"&#41; = "GET"
    env.Item&#40;"QUERY_STRING"&#41; = Request.QueryString
    set oExec = WshShell.Exec&#40;Server.MapPath&#40;"search.cgi"&#41;&#41;
    oExec.StdOut.ReadLine&#40;&#41; ' skip the HTTP header line
    Response.Write&#40;oExec.StdOut.ReadAll&#40;&#41;&#41;
    %>
    ---
    David

    Comment


    • #3
      David,

      Thanks but I was looking for VB code - like the C# code supplied in the link I posted - to use in an ASP.NET page, not a classic ASP page.

      Am I missing something?

      TLW

      Comment


      • #4
        I has assumed you meant VB script which is more commonly used for web sites than VB.

        But now I understand you are using ASP.NET with VB.

        We don't have any VB ASP.NET code. We only have C# ASP.NET. But one would assume anything that can be done in C# can also be done in the new .NET VB. All the API calls & objects should be the same.

        For other readers.
        Note that ASP.NET and ASP are actually interfaces and not languages. VB, C#, JScript & VBScript are the languages that make use of ASP.NET and/or ASP. In fact there are about 25 different .NET languages that can be used with ASP.NET.

        Unfortunately Microsoft has really screwed up the terminology. So we have VB (classic), VB.NET and VB script all of which are incompatible.

        ----
        David

        Comment


        • #5
          A lot of folks use VB.net as well as C#.net

          Fortunately, it's fairly easy to translate between the two. Here is my stab at the VB.net version:

          Dim paramStr As String = ""
          Dim parampos As Integer = Request.RawUrl.IndexOf("?")
          If (parampos >= 0) Then
          paramStr = Request.RawUrl.Substring((parampos + 1))
          End If
          Dim psi As ProcessStartInfo = New ProcessStartInfo
          psi.FileName = Server.MapPath("search.cgi")
          psi.EnvironmentVariables("REQUEST_METHOD") = "GET"
          psi.EnvironmentVariables("QUERY_STRING") = paramStr
          psi.RedirectStandardInput = false
          psi.RedirectStandardOutput = true
          psi.UseShellExecute = false
          Dim proc As Process = Process.Start(psi)
          proc.StandardOutput.ReadLine
          Dim zoom_results As String = proc.StandardOutput.ReadToEnd
          ' read from stdout
          proc.WaitForExit
          ' Print the output
          Response.Write(zoom_results)

          Comment


          • #6
            Did you get this to work? I use VB.NET in my ASP.NET, not C#. I'm concerned about making this work before I purchase it.

            Thanks

            Comment


            • #7
              We have tested the VB.NET code posted above, and it appears to work fine. We'll probably update our website with a version of this soon. Thanks to the anonymous poster's contribution.

              Note that you can test this with the Free Edition of Zoom (which will only index and search 50 pages) before you decide whether you want to purchase it.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment

              Working...
              X