Click here to Skip to main content
12,946,816 members (47,578 online)
Rate this:
Please Sign up or sign in to vote.
This is my ASP.Net code
PRN.Text = Request["PRN"].ToString();

This Code i want to convert to classic ASP.
Its grateful for me if anybody give me Conversion of above code to Classic ASP.

Posted 16-May-11 4:09am
Updated 16-May-11 6:49am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

In classic asp, if you want to assign request variable value, then you can do the following:

Dim myVar
myVar = Request.form("PRN")
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

PRN.Text = Request.Form["PRN"].ToString();
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Imports System.Security.Cryptography.X509Certificates
Imports System.Net.Security
Imports System.IO
Imports System.Net
''' <summary>
''' This Function is Used for SSL Certificate Validation
''' </summary>
''' <remarks></remarks>
Public Class SMSNICGateway
    Function CertificateValidationCallBack( _
   ByVal sender As Object, _
   ByVal certificate As X509Certificate, _
   ByVal chain As X509Chain, _
   ByVal sslPolicyErrors As SslPolicyErrors _
) As Boolean
        Return True
    End Function
    ''' <summary>
    ''' </summary>
    ''' <param name="receiver">Comma Seperated List of 10 digit Mobile Nos. e.g. 9568693696,9856235869,8562354859</param>
    ''' <param name="message">Text Message to be Sent</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function Send_Message(ByVal receiver As String, ByVal message As String) As String
        Dim UserName As String = "XXXXXX"
        Dim Password As String = "XXXXXX"
        Dim smsFrom As String = "XXXXXX"
        Dim smsTo As String = receiver
        Dim concat As Integer
        If (Len(message) > 160) Then
            concat = 1
            concat = 0
        End If
        ' concat parameter is used as mentioned in the NIC SMS service document

        Dim GateWayURL As String = "" + UserName + "&pass=" + Password + "&send=" + smsFrom + "&dest=" + smsTo + "&msg=" + message + "&concat=" & concat & ""
        ' GateWayURL and  Query String Parameter Names used here are Provided by NIC
        'Create HTTP Web Request to be sent in background
        Dim objUTFEncode As New UTF8Encoding
        Dim arrRequest As Byte()
        Dim objStreamReq As Stream
        Dim objStreamRes As StreamReader
        Dim objHttpRequest As HttpWebRequest
        Dim objHttpResponse As HttpWebResponse
        Dim objUri As New Uri(GateWayURL)
        objHttpRequest = WebRequest.Create(objUri)
        objHttpRequest.KeepAlive = False
        objHttpRequest.Timeout = 40000
        objHttpRequest.Method = "POST" ' You can also use GET method here
        objHttpRequest.ContentType = "application/x-www-form-urlencoded"
        ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf CertificateValidationCallBack) ' For SSL Certificate Validation
        arrRequest = objUTFEncode.GetBytes(message)
        objHttpRequest.ContentLength = arrRequest.Length
        objStreamReq = objHttpRequest.GetRequestStream()
        objStreamReq.Write(arrRequest, 0, arrRequest.Length)

        'Get  HTTP Response
            objHttpResponse = objHttpRequest.GetResponse()
            objStreamRes = New StreamReader(objHttpResponse.GetResponseStream(), Encoding.ASCII)
            Dim status As String = objStreamRes.ReadToEnd()
            Return status 'If first two characters of status are "NH" then SMS  is Sent Successfully otherwise Error Message is returned
        Catch ex As WebException
            Return ex.ToString
        End Try
    End Function
End Class
Sandeep Mewara 26-Jun-12 5:22am
And what is this code for? can you elaborate on what this post says ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,059
CHill60 3,235
Maciej Los 2,538
Jochen Arndt 1,935
ppolymorphe 1,795

Advertise | Privacy | Mobile
Web01 | 2.8.170518.1 | Last Updated 26 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100