dcsimg
July 22, 2018
Hot Topics:

Writing Active Server components in Visual Basic

  • April 30, 1998
  • By Thornton Rose
  • Send Email »
  • More Articles »


' Class FileIO

Option Explicit

Private objApplication As Application  ' Reference to Application object
Private objResponse As Response        ' Reference to Response object

' OnStartPage():
'
' This procedure is called when an instance of this class is created in an
' Active Server Page. It gets references to the Application and Response
' objects that are being used in the ASP page that created the instance of
' this class.
'
Public Sub OnStartPage(objScriptingContext As ScriptingContext)
   Set objApplication = objScriptingContext.Application()
   Set objResponse = objScriptingContext.Response()
End Sub

' OnEndPage():
'
' This procedure is called when an instance of this class is destroyed in 
' an Active Server Page. It is used to clean up object references.
'
Public Sub OnEndPage()
   Set objApplication = Nothing
   Set objResponse = Nothing
End Sub

' help():
'
' Writes help information to the response stream.
'
Public Sub help()
   objResponse.Write "

Class FileIO

" & vbCrLf objResponse.Write "Usage:" & vbCrLf objResponse.Write "set o = Server.CreateObject(""ASCExample.FileIO"")" & vbCrLf objResponse.Write "

Methods:" & vbCrLf objResponse.Write "

    " & vbCrLf objResponse.Write "
  • help() - shows help" & vbCrLf objResponse.Write "
  • fileSize(strName) - returns size of named file" & vbCrLf objResponse.Write "
  • fileExists(strName) - returns True if named file exists" & vbCrLf objResponse.Write "
  • deleteFile(strName) - deletes named file" & vbCrLf objResponse.Write "
  • appendLine(strName, strLine) - appends line to file" & vbCrLf objResponse.Write "
" & vbCrLf End Sub ' fileSize(): ' ' Returns the size of the file with the given name. ' Public Function fileSize(strFileName) As Long fileSize = FileLen(strFileName) End Function ' fileExists(): ' ' Returns True if the specified file exists. Note that the given file ' specification can contain wildcard characters. ' Public Function fileExists(strFileSpec) As Boolean fileExists = (Dir(strFileSpec) <> "") End Function ' deleteFile(): ' ' Deletes files that match the given file specification, which can include ' wildcard characters. ' Public Sub deleteFile(strFileSpec) Call Kill(strFileSpec) End Sub ' appendLine(): ' ' Appends a line to a text file (which is handy when working with log ' files.) ' Public Sub appendLine(strFileName, strLine) Dim objFileSystem As FileSystemObject Dim objStream As TextStream Set objFileSystem = New FileSystemObject Set objStream = objFileSystem.OpenTextFile(strFileName, 8, True, False) objStream.WriteLine strLine objStream.Close End Sub ' End Class FileIO [end] -->

  • Save everything and compile. That's it.

    Testing

    Testing your Active Server component is easy (although debugging can get tedious). A few lines of VBScript or JavaScript in an ASP page is all that is required. Here's the test script:

    <html> <head> <meta name="WT.qs_dlk" content="W1UaYArIZ7wAAGtYeX8AAAAO"/> <meta name="WT.qs_shmv" content="hv20180525-shelton.sf.quinstreet.net"/> <meta name="DCS.dcsipa" content="1" /> <meta name="inject_params" content="WT.qs_dlk=W1UaYArIZ7wAAGtYeX8AAAAO&"/> <script> document.cookie = 'inject_params=WT.qs_dlk=W1UaYArIZ7wAAGtYeX8AAAAO&; path=/; domain=developer.com;'; document.cookie = 'WMUUID=W1UaYArIZ7wAAGtYeX8AAAAO; path=/; domain=developer.com;'; </script> <title>ASCExample Tester</title> <script> window.webtrendsAsyncInit=function(){ var dcs=new Webtrends.dcs().init({ dcsid:"dcs38irdn10000g0vc4171yva_9y7z", domain:"www.qsstats.com", timezone:-8, i18n:true, onsitedoms:"developer.com", fpcdom:".developer.com", plugins:{ //hm:{src:"//s.webtrends.com/js/webtrends.hm.js"} } }).track(); }; (function(){ var s=document.createElement("script"); s.async=true; s.src="/imageserver/common/v10/webtrends.min.js"; var s2=document.getElementsByTagName("script")[0]; s2.parentNode.insertBefore(s,s2); }()); </script> <noscript><img alt="dcsimg" id="dcsimg" width="1" height="1" src="//www.qsstats.com/dcs38irdn10000g0vc4171yva_9y7z/njs.gif?dcsuri=/index.php/net/asp/article.php/10917_602621_3/Writing-Active-Server-components-in-Visual-Basic.htm&dcsipa=1&amp;WT.js=No&amp;WT.tv=10.4.1&amp;dcssip=www.developer.com&amp;WT.qs_dlk=W1UaYArIZ7wAAGtYeX8AAAAO&"/></noscript> </head> <h3>ASCExample Tester</h3> <% ' Create a FileIO object. set objFileIO = Server.CreateObject("ASCExample.FileIO") %> <hr> <% ' Get some help from the FileIO object. objFileIO.help %> <hr> <% ' Create a file for testing. strLogFileName = "c:\temp\test.log" objFileIO.appendLine strLogFileName, "This is line 1." %> <!-- Get the file info. --> strLogFileName = <%= strLogFileName %><br> fileExists() => <%= CStr(objFileIO.fileExists(strLogFileName)) %><br> fileSize() => <%= objFileIO.fileSize(strLogFileName) %> bytes <% ' Delete the file. objFileIO.deleteFile(strLogFileName) %> <p> <!-- Check the file existance again. --> File deleted.<br> fileExists() => <%= CStr(objFileIO.fileExists(strLogFileName)) %> </html> [end] </pre> <!--end_section--></p> <br/> <br> <br> <br/>Page 3 of 3<br/><br/><div style="height: 40px;" id="pages"> <div style="margin-left: 50%;"> <ul style="margin-left: -120px;"> <li class="arrow-left"><a href="/net/asp/article.php/10917_602621_2/Writing-Active-Server-components-in-Visual-Basic.htm"><img src="/images0/arrow_left.jpg" width="16" height="16" /></a></li> <li class="begin-li"></li> <li><a href="/net/asp/article.php/602621/Writing-Active-Server-components-in-Visual-Basic.htm">1</a> </li> <li><a href="/net/asp/article.php/10917_602621_2/Writing-Active-Server-components-in-Visual-Basic.htm">2</a> </li> <li><a href="javascript:void(0);">3</a> </li> <li class="end-li"></li> </ul> </div> </div> <br/><br/> <div id="nodeSearchWidget" style="display: none"> <style> #searchWidget{ border-bottom: 1px solid #344a70; } #searchWidget #top_bar{ background-color: #ffc926; height: 28px; width: 590px; padding-top: 8px; padding-left: 8px; padding-right: 8px; border-bottom: 1px solid #344a70; } #searchWidget #top_bar p { font-size:18px; font-family:'Roboto',sans-serif; font-weight:700; color: #000000; line-height: 21px; text-align: left; letter-spacing: 0em; } #searchWidget #top_bar p span{ font-size:10px; font-family:'Roboto Condensed', sans-serif; font-weight:500; color: #31313f; line-height: 9.14px; text-align: left; letter-spacing: 0.02em; float:right; padding-top: 6px; } #searchWidget .searchWidgetSteps h3{ font-size:32px; font-family:'Roboto',sans-serif; font-weight:700; color: #20202f; line-height: 36px; text-align: center; letter-spacing: 0em; margin-top: 20px; word-spacing: 5px; } #searchWidget .searchWidgetSteps{ width: 100%; text-align: center; } #searchWidget .searchWidgetSteps .step-no-question{ width: 100%; display: table; margin: 25px; } #searchWidget .searchWidgetSteps .step-no-question img{ float: right; margin-right: 24px; } .tracker-bar{ margin-bottom: 10px; } #searchWidget #search_step1 .topicsRow{ overflow: auto; display: inline-flex; } .topics { margin-right: 52px; cursor: pointer; } .topics:hover{ text-decoration: underline; } .topics:last-child{ margin-right: 0; } .topics p{ font-size:13.12px; font-family:'Roboto',sans-serif; font-weight:700; color: #000000; text-align: center; line-height: 15.74px; letter-spacing: 0em; margin-top: 5px; } #search-bottom-logo{ clear: both; } #search-bottom-logo img{ padding-left: 25px; padding-right: 25px; } #search_step5 p{ font-size:18px; font-family:'Roboto',sans-serif; font-weight:300; color: #20202f; text-align: center; line-height: 36px; letter-spacing: 0em; } #search_step5 p span{ font-weight:700; } #search_step5 #progresscircle{ margin-left: 32%; } #search_step6{ min-height: 182px; } .search_step6_child{ background:url('/hqb2b/img/searchwidget/article-match.png') no-repeat 63px 8px; margin-top: 43px; margin-bottom: 10px; float: left; } .search_step6_child #asset-img{ margin-right: 20px; float: left; margin-left: 122px; display: inline-block; } .search_step6_child #asset-details{ width: 303px; float: left; margin-bottom: 15px; margin-top: 10px; } .search_step6_child #asset-details h2{ font-size:23.61px; font-family:'Roboto',sans-serif; font-weight:700; color: #1f1f2c; text-align: left; line-height: 25.76px; letter-spacing: 0em; margin-bottom: 30px; margin-left: 15px; } .search_step6_child #asset-details p { font-size:10px; font-family:'Roboto Condensed', sans-serif; font-weight:300; color: #1f1f2c; text-align: left; line-height: 10.79px; letter-spacing: 0.02em; margin-left: 20px; } .search_step6_child #asset-details a { font-size:17.85px; font-family:'Roboto',sans-serif; font-weight:700; color: #ffffff; text-align: center; line-height: 15.3px; letter-spacing: 0em; background-color: #2c9feb; padding-left: 55px; padding-right: 12px; padding-top: 4px; padding-bottom: 5px; border-radius: 20px; text-decoration: none; } .search_step6_child span{ font-size:18px; font-family:'Roboto',sans-serif; font-weight:700; color: #3399ff; text-align: left; line-height: 50.52px; letter-spacing: 0em; } .search_step6_child .prev_match{ float: left; cursor: pointer; } .search_step6_child .next_match{ float: right; cursor: pointer; } .search_step6_child .prev_match:hover{ text-decoration: underline; } .search_step6_child .next_match:hover{ text-decoration: underline; } .styled-select { background: url(/hqb2b/img/searchwidget/dropdown_arrow.png) no-repeat 94% 5px; height: 38px; overflow: hidden; width: 288px; } .select-background{ background-color: #2c9feb; } .styled-select select { background: transparent; border: none; height: 38px; padding: 5px; /* If you add too much padding here, the options won't show in IE */ width: 288px; } .rounded { -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; } .inputdiv{ display: table-cell; text-align: center; vertical-align: middle; } .inputdiv select option{ text-align: center; color: #fff; background-color: #2c9feb; } .inputdiv select{ font-size: 15.58px; font-family: 'Roboto',sans-serif; font-weight: 700; color: #FFF; line-height: 18.7px; float: left; letter-spacing: 0em; -webkit-appearance: none; -moz-appearance: none; text-indent: 1px; text-overflow: ''; } .inputdiv select::-ms-expand { display: none; } #searchWidgetContainer { margin: 20px; width: 141px; height: 143px; position: relative; } </style> <div id="searchWidget"> <div id="top_bar"> <p> IT Solutions Builder <span>TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD</span> </p> </div> <div id="search_step1" class="searchWidgetSteps" > <h3> Which topic are you interested in? </h3> <div class="topicsRow" id="topic-row1"> <div class="topics" id="B2B_PRODUCT_MOBILE"> <img src="/hqb2b/img/searchwidget/icon-mobile.png"/> <p>Mobile</p> </div> <div class="topics" id="B2B_PRODUCT_SECURITY"> <img src="/hqb2b/img/searchwidget/icon-security.png"/> <p>Security</p> </div> <div class="topics" id="B2B_PRODUCT_NETWORKING"> <img src="/hqb2b/img/searchwidget/icon-networks.png"/> <p>Networks/IoT</p> </div> <div class="topics" id="B2B_PRODUCT_DEVELOPMENT_CLOUD"> <img src="/hqb2b/img/searchwidget/icon-cloud.png"/> <p>Cloud</p> </div> <div class="topics" id="B2B_PRODUCT_STORAGE"> <img src="/hqb2b/img/searchwidget/icon-datastorage.png"/> <p>Data Storage</p> </div> </div> <div class="topicsRow" id="topic-row2"> <div class="topics" id="B2B_PRODUCT_APPLICATIONS"> <img src="/hqb2b/img/searchwidget/icon-apps.png"/> <p>Applications</p> </div> <div class="topics" id="B2B_PRODUCT_DEVELOPMENT"> <img src="/hqb2b/img/searchwidget/icon-dev.png"/> <p>Development</p> </div> <div class="topics" id="B2B_PRODUCT_IT_MANAGEMENT_PRACTICES"> <img src="/hqb2b/img/searchwidget/icon-itmgmt.png"/> <p>IT Management</p> </div> <div class="topics" id="B2B_PRODUCT"> <img src="/hqb2b/img/searchwidget/icon-other.png"/> <p>Other</p> </div> </div> <input type="hidden" name="selectedPortalServiceCode" id="selectedPortalServiceCode"> </div> <div id="search_step2" class="searchWidgetSteps" style="display: none"> <h3> What is your company size? </h3> <div class="step-no-question"> <img src="/hqb2b/img/searchwidget/article-Q2.png"/> <div class="inputdiv"> <div class="styled-select select-background rounded"> <select name="NumberofEmployeesRange" id="numberofEmployeesRange"> <option>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select company size</option> <option value="9" >1-9</option> <option value="24" >10-24</option> <option value="49" >25-49</option> <option value="99" >50-99</option> <option value="249" >100-249</option> <option value="499" >250-499</option> <option value="999" >500-999</option> <option value="1999" >1000+</option> </select> </div> </div> </div> <div class="tracker-bar"> <img src="/hqb2b/img/searchwidget/tracker-2.png"/> </div> </div> <div id="search_step3" class="searchWidgetSteps" style="display: none"> <h3> What is your job title? </h3> <div class="step-no-question"> <img src="/hqb2b/img/searchwidget/article-Q3.png"/> <div class="inputdiv"> <div class="styled-select select-background rounded"> <select name="Designation" id="designation"> <option>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select job title</option> <option value="C-Level/President">C-Level/President</option> <option value="Manager">Manager</option> <option value="VP">VP</option> <option value="Staff (Associate/Analyst/etc.)">Staff (Associate/Analyst/etc.)</option> <option value="Director">Director</option> </select> </div> </div> </div> <div class="tracker-bar"> <img src="/hqb2b/img/searchwidget/tracker-3.png"/> </div> </div> <div id="search_step4" class="searchWidgetSteps" style="display: none"> <h3> What is your job function? </h3> <div class="step-no-question"> <img src="/hqb2b/img/searchwidget/article-Q4.png"/> <div class="inputdiv"> <div class="styled-select select-background rounded"> <select name="JobFunction" id="jobFunction"> <option>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select job function</option> <option value="IT - General">IT - General</option> <option value="IT - Project Management">IT - Project Management</option> <option value="IT - Systems/Network Administration">IT - Systems/Network Administration</option> <option value="IT - Developer">IT - Developer</option> <option value="IT - Tester/QA">IT - Tester/QA</option> <option value="Accounting/Finance/Legal">Accounting/Finance/Legal</option> <option value="Academic/Research">Academic/Research</option> <option value="Administrative">Administrative</option> <option value="General Management">General Management</option> <option value="Human Resources">Human Resources</option> <option value="Marketing">Marketing</option> <option value="Operations">Operations</option> <option value="Sales">Sales</option> <option value="Consultant">Consultant</option> <option value="Other">Other</option> </select> </div> </div> </div> <div class="tracker-bar"> <img src="/hqb2b/img/searchwidget/tracker-4.png"/> </div> </div> <div id="search_step5" class="searchWidgetSteps" style="display: none" > <p><span>Searching our resource database</span> to find your matches...</p> <div id="progresscircle"> <!--<img src="/hqb2b/img/searchwidget/progress.gif" height="140"/>--> <div id="searchWidgetContainer"></div> </div> </div> <div id="search_step6" class="searchWidgetSteps" style="display: none"> </div> <div id="search-bottom-logo"> <!-- <img src="/hqb2b/img/searchwidget/eSignLive-Logo-BlackOrange-1.png"/> <img src="/hqb2b/img/searchwidget/Globalscape_Logo.png"/> <img src="/hqb2b/img/searchwidget/IBM_logo.png"/> <img src="/hqb2b/img/searchwidget/Green_Igloo_Logo.png"/> <img src="/hqb2b/img/searchwidget/Intel-logo.svg.png"/>--> </div> <script type="text/javascript" src="/hqb2b/js/underscore.js"> </script> <script type="text/javascript" src="/hqb2b/js/progressbar.js"> </script> <script type="text/javascript" src="/hqb2b/js/searchWidgetTraker.js"> </script> <script> // progressbar.js@1.0.0 version is used // Docs: http://progressbarjs.readthedocs.org/en/1.0.0/ var bar = new ProgressBar.Circle(searchWidgetContainer, { color: '#20202f', // This has to be the same size as the maximum width to // prevent clipping strokeWidth: 4, trailWidth: 1, easing: 'easeInOut', duration: 9000, text: { autoStyleContainer: false }, from: {color: '#2c9feb', width: 4}, to: {color: '#2c9feb', width: 4}, // Set default step function for all animate calls step: function(state, circle) { circle.path.setAttribute('stroke', state.color); circle.path.setAttribute('stroke-width', state.width); var value = Math.round(circle.value() * 100); if (value === 0) { circle.setText(''); } else { circle.setText(value + '%'); } if (value === 99) { $("#search_step5").hide(); $('#search_step6').show('slide', {direction: 'right'}, 500); } } }); bar.text.style.fontFamily = '"Roboto", sans-serif'; bar.text.style.fontSize = '40.25px'; $(".topics").click(function() { $("#search_step1").hide(); $('#search_step2').show('slide', {direction: 'right'}, 500); if (typeof SearchWidgetTracker != 'undefined') SearchWidgetTracker.log(SearchWidgetTracker.link_click, 'topic_link', 'search_widget', $(this).children('p').text()); $("#selectedPortalServiceCode").val($(this).attr('id')); }); $('#search_step2 select').change(function() { $("#search_step2").hide(); if (typeof SearchWidgetTracker != 'undefined') SearchWidgetTracker.log(SearchWidgetTracker.form_elem_change, 'NumberofEmployeesRange', 'search_widget', $('#search_step2 select').val()); $('#search_step3').show('slide', {direction: 'right'}, 500); }) $('#search_step3 select').change(function() { $("#search_step3").hide(); if (typeof SearchWidgetTracker != 'undefined') SearchWidgetTracker.log(SearchWidgetTracker.form_elem_change, 'Designation', 'search_widget', $('#search_step3 select').val()); $('#search_step4').show('slide', {direction: 'right'}, 500); }) $('#search_step4 select').change(function() { $("#search_step4").hide(); if (typeof SearchWidgetTracker != 'undefined') SearchWidgetTracker.log(SearchWidgetTracker.form_elem_change, 'JobFunction', 'search_widget', $('#search_step4 select').val()); $('#search_step5').show('slide', {direction: 'right'}, 500); bar.animate(1.0); // Number from 0.0 to 1.0 }); $('#searchWidget').on("click", "#downloadbtn", function(e) { e.preventDefault(); if (typeof SearchWidgetTracker != 'undefined') SearchWidgetTracker.log(SearchWidgetTracker.button_click, 'asset_button', 'search_widget'); var url = $(this).attr('href'); window.open(url, '_blank'); }); </script> </div> </div> <!-- START COMMENTING CODE --> <p class="style1"> <noscript>Please enable Javascript in your browser, before you post the comment! Now Javascript is disabled.</noscript> </p> <a name="commentresponse"> <div id="comment_response"></div> </a> <div id="comment_error" class="error"></div> <div class="comment_wrapper"> <div style="font-weight: bold;"><font id="commentCount">0</font> Comments&nbsp;<a href="#comment_form" style="text-decoration: underline;">(click to add your comment)</a></div> <div id="comment_pagination_top"></div> <div id="comment_page_container"></div> <div id="comment_pagination_bottom"></div> <div id="comment_form"> <div style="border-bottom: 2px solid rgb(102, 102, 102); width: 100%; height: 20px; margin-bottom: 5px; clear: left;"></div> <img border="0" src="https://assets.devx.com/Icon/icon_comment.png" alt="" />Comment and Contribute<p></p> </div> <div style="background-color:#EFEFEF;"> <p>&nbsp;</p> <form id="commentform" name="commentform" method="post" > <p class="commenttext"> <input type="text" tabindex="1" size="22" value="" id="author" name="author"> <label for="author">Your name/nickname</label> </p> <p class="commenttext"> <input type="text" tabindex="2" size="22" value="" id="email" name="email"> <label for="email">Your email</label> </p> <p class="commenttext"> <input type="text" tabindex="3" value="" size="22" id="blurbTitle" name="blurbTitle"> <label for="blurbTitle">Subject</label> </p> <p class="commenttext"> <textarea id="commentdetails" name="commentdetails" onkeydown="limitText(this.form.commentdetails,this.form.countdown,1200);" onkeyup="limitText(this.form.commentdetails,this.form.countdown,1200);" style="overflow: auto; font-family: arial,helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 9pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;" rows="10" cols="80" tabindex="4"></textarea><br/> <span style="font-size:8pt;margin-left:10px;">(Maximum characters: 1200). You have <input type="text" size="4" value="1200" name="countdown"> characters left.</span> <p class="commenttext"> <div class="g-recaptcha" data-sitekey="6LcX1EwUAAAAAIfaONTfx2ElFE1OokB6SZI1zT-W" data-callback="recaptchaCallback" data-expired-callback="recaptchaExpired"></div> </p> <p> <input type="submit" value="Submit Your Comment" tabindex="6" id="submit" disabled="disabled" name="submit" onclick="return validate();" />&nbsp;<img border="0" align="center" src="/images0/ajax-loader.gif" alt="" id="ajax_loading_img" style="vertical-align:middle;visibility:hidden;"> </p> <input type="hidden" id="key" value="1838930" name="key"> <input type="hidden" value="0" id="comment_parent" name="comment_parent"> <input type="hidden" value="0" id="totalComments" name="totalComments"> </form> <p>&nbsp;</p> </div> </div> <script type="text/javascript" src="/javascripts/comments.js"> </script> <br> <!-- END COMMENTING CODE --> <div class="vspace"></div> </div> <!-- article div ends --> </div> <div class="col colRight dimMainRight"> <div class="modal"></div> <div id="newsletter_subscribe" class="section"> <div id="heading" style="margin-top:5px"><h2>Enterprise Development Update</h2></div> <div id="staticText">Don't miss an article. Subscribe to our newsletter below.</div> <div id="nl_error" style="display:none;"></div> <div id="nl_success" style="display:none;"></div> <div id="nl_question_form"> <div style="float:left;width:70%"> <input type="text" id="nl_email" name="nl_email" maxlength="255" onblur="if (this.value == '') {this.value = 'Enter Email Address';}" onfocus="if(this.value == 'Enter Email Address') {this.value = '';}" value="Enter Email Address"> <input type="hidden" name="NewsletterSignup" value="Enterprise Development Update" id="NewsletterSignup"> <input type="hidden" name="NewsletterKey" value="1423" id="NewsletterKey"> <input type="hidden" name="businessUnit" value="Internet.com" id="businessUnit"> <input type="hidden" name="RegistrationWebsite" value="www.developer.com" id="RegistrationWebsite"> </div> <div style="float:left;width:30%"> <input type="submit" name="btnSubscribe" onClick="javascript:doNewNLSubmit();" value="SIGN UP" id="nl_submit_button"><br> </div> </div> <div class="vspace"></div> <p style="padding: 8px 12px 0 12px;text-align: left;font-size: 13px;">By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the <a style="text-decoration: underline; color: #002e5f;text-shadow:none;" href="/privacy" rel="nofollow">Quinstreet Privacy Policy</a>.</p> </div> <script language="JavaScript"> function doNewNLSubmit() { var email = $("#nl_email").val(); var NewsletterKey = $("#NewsletterKey").val(); var businessUnit = $("#businessUnit").val(); var NewsletterSignup = $("#NewsletterSignup").val(); var RegistrationWebsite = $("#RegistrationWebsite").val(); if (validateEml(email)) { $('#nl_error').html('<div id="nl_error_msg" align="center">Invalid Email Address</div>'); $("#nl_error").show(); } else { $("#nl_error_msg").remove(); $("#nl_error").hide(); $.ajax({ type:"POST", url:"/newnlsub", data:{email:email,NewsletterKey:NewsletterKey,RegistrationWebsite:RegistrationWebsite,businessUnit:businessUnit,NewsletterSignup:NewsletterSignup}, dataType:"json", async: true, beforeSend: function () { $("body").addClass("loading"); }, success:function(data) { if (data.result == "InComplete") { $("#nl_question_form").hide(); $("#staticText").hide(); $("#heading").hide(); $("#nl_success").html('<div id="nl_success_msg" align="center">'+data.message+'</div>'); $("#nl_success").show(); } else if(data.result == "Complete") { openLoginBox(email); } else if(data.result == "NewUser") { openRegisterBox(email); } else { $('#nl_error').html('<div id="nl_error_msg" align="center">'+data.message+'</div>'); $("#nl_error").show(); } }, complete: function () { $("body").removeClass("loading"); } }); } } function validateEml(email) { var reg = /^([A-Za-z0-9_\-\.]{2,})+\@([A-Za-z0-9_\-\.]{2,})+\.([A-Za-z]{2,4})$/; if(reg.test(email) == false) return true; else return false; } function openLoginBox(email){ $('body').append('<div class="login-light-box"><div class="login-content" id="loginLightBoxContainer"><div id="loginLightBox" class="login-iframe"></div>'); $('.login-light-box').hide(); var linkUrl = 'https://o1.qnsr.com/cgi/r?WT.qs_dlk=W1UaYArIZ7wAAGtYeX8AAAAO;;n=203;c=1387912;s=15939;x=7936;f=201306031137030;u=j;z=TIMESTAMP;k=https://assetform.developer.com/acl/accountController.jsp?css=developerCom/developerComArticleRegistrationForm.css&sdn=Developer&w=https://www.developer.com&u=%2Findex.php%2Fnet%2Fasp%2Farticle.php%2F10917_602621_3%2FWriting-Active-Server-components-in-Visual-Basic.htm%3F&isIframed=yes&rand=67692&formType=loginForm&newregistration=y&nlsubuser=y'+'&email='+email; var iframe = '<div style="float: left; position: absolute; right: 0;top:5px;"><a style="float:right; margin:5px; width:15px;" href="#" onclick="closeBox();">' + '<img alt="Close Window" src="/itpc/img/close-button-small.jpg"></a></div>' + '<iframe id="myframe" src="'+ linkUrl + '" scrolling="no" width="488" height="400" frameborder="0" marginheight="0" ></iframe>'; $('.login-iframe').html(iframe); $('.login-light-box').addClass('overlay'); $('.login-light-box').fadeIn(125); return false; } function openRegisterBox(email){ $('body').css("overflow","hidden"); $('body').append('<div class="login-light-box register-light-box"><div class="login-content register-content" id="loginLightBoxContainer"><div id="loginLightBox" class="login-iframe register-iframe"></div>'); $('.login-light-box').hide(); var linkUrl = 'https://o1.qnsr.com/cgi/r?WT.qs_dlk=W1UaYArIZ7wAAGtYeX8AAAAO;;n=203;c=1387912;s=15939;x=7936;f=201306031137030;u=j;z=TIMESTAMP;k=https://assetform.developer.com/acl/accountController.jsp?css=developerCom/developerComArticleRegistrationForm.css&sdn=Developer&w=https://www.developer.com&u=%2Findex.php%2Fnet%2Fasp%2Farticle.php%2F10917_602621_3%2FWriting-Active-Server-components-in-Visual-Basic.htm%3F&isIframed=yes&rand=67692&formType=registrationForm&newregistration=y&nlsubuser=y&popupregistration=y&newuserregistration=y'+'&email='+email; var iframe = '<div style="float: left; position: absolute; right: 0;top:5px;"><a style="float:right; margin:5px; width:15px;" href="#" onclick="closeBox();">' + '<img alt="Close Window" src="/itpc/img/close-button-small.jpg"></a></div>' + '<iframe id="myframe" src="'+ linkUrl + '" scrolling="no" width="488" height="813" frameborder="0" marginheight="0" ></iframe>'; $('.login-iframe').html(iframe); $('.login-light-box').addClass('overlay'); $('.login-light-box').fadeIn(125); return false; } function closeBox(){ jQuery('.login-light-box, .overlay').hide(); } </script> <div class="vspace"></div> <div class="adsBox"> <!-- QS-AD: 'imu' start --> <script language="JavaScript"> var t=displayDFPTag("imu"); document.write(t); </script> <!-- QS-AD: 'imu' end --> </div> <div class="vspace"></div> <div id="mostPopularStories" class="section"> <div class="sectionHeader"> <h2>Most Popular Developer Stories</h2> <a href="#" class="more"></a> </div> <div class="sectionContent"> <div class="tabs"> <div class="tabsMenu clearfix"> <ul> <li><a href="#mostPopularToday" class="selected">Today</a></li> <li><a href="#mostPopularThisWeek">This Week</a></li> <li><a href="#mostPopularAllTime">All-Time</a></li> </ul> </div> <div class="tabsContents"> <div class="tabsContent selected" id="mostPopularToday"> <ul> <li><a href="http://www.developer.com/java/data/article.php/3417381/Using-JDBC-with-MySQL-Getting-Started.htm"><span class="graytext">1</span> Using JDBC with MySQL, Getting Started</a></li> <li><a href="http://www.developer.com/design/article.php/2109801/Creating-Use-Case-Diagrams.htm"><span class="graytext">2</span> Creating Use Case Diagrams</a></li> <li><a href="http://www.developer.com/java/other/article.php/3556176/An-Introduction-to-Java-Annotations.htm"><span class="graytext">3</span> An Introduction to Java Annotations</a></li> <li><a href="http://www.developer.com/java/other/article.php/3559931/Hibernate-Basics.htm"><span class="graytext">4</span> Hibernate Basics</a></li> <li><a href="http://www.developer.com/net/asp/article.php/3096831/Using-ASPNET-To-Send-Email.htm"><span class="graytext">5</span> Using ASP.NET To Send Email</a></li> </ul> </div> <div class="tabsContent" id="mostPopularThisWeek"> <ul> <li><a href="http://www.developer.com/java/data/article.php/3417381/Using-JDBC-with-MySQL-Getting-Started.htm"><span class="graytext">1</span> Using JDBC with MySQL, Getting Started</a></li> <li><a href="http://www.developer.com/lang/php/article.php/3896056/10-Experimental-PHP-Projects-Pushing-the-Envelope.htm"><span class="graytext">2</span> 10 Experimental PHP Projects Pushing the Envelope</a></li> <li><a href="http://www.developer.com/java/other/article.php/3559931/Hibernate-Basics.htm"><span class="graytext">3</span> Hibernate Basics</a></li> <li><a href="http://www.developer.com/java/other/article.php/3556176/An-Introduction-to-Java-Annotations.htm"><span class="graytext">4</span> An Introduction to Java Annotations</a></li> <li><a href="http://www.developer.com/db/article.php/3379271/Oracle-Programming-with-PLSQL-Collections.htm"><span class="graytext">5</span> Oracle Programming with PL/SQL Collections</a></li> </ul> </div> <div class="tabsContent" id="mostPopularAllTime"> <ul> <li><a href="http://www.developer.com/java/data/article.php/3417381/Using-JDBC-with-MySQL-Getting-Started.htm"><span class="graytext">1</span> Using JDBC with MySQL, Getting Started</a></li> <li><a href="http://www.developer.com/java/other/article.php/3559931/Hibernate-Basics.htm"><span class="graytext">2</span> Hibernate Basics</a></li> <li><a href="http://www.developer.com/db/article.php/3379271/Oracle-Programming-with-PLSQL-Collections.htm"><span class="graytext">3</span> Oracle Programming with PL/SQL Collections</a></li> <li><a href="http://www.developer.com/java/other/article.php/3556176/An-Introduction-to-Java-Annotations.htm"><span class="graytext">4</span> An Introduction to Java Annotations</a></li> <li><a href="http://www.developer.com/design/article.php/2109801/Creating-Use-Case-Diagrams.htm"><span class="graytext">5</span> Creating Use Case Diagrams</a></li> </ul> </div> </div> </div> </div> </div> <!-- Code to put on site page to show pinning option --> <!-- commented out 10/22 as per CR "CHG231107: Remove IE 9 Site pinning check" <script type="text/javascript" language="javascript"> if(jQuery.browser.msie){ if(document.documentMode != undefined && document.documentMode==9){ if (!window.external.msIsSiteMode()) { document.write('<div id="pinMeContainer"><img class="msPinSite" src="/images0/developer64x64.png" height="64" weight="64" /><br/><span id="pinMe">To Pin this site, drag this image to the left to your Windows Taskbar. Try it now!</span></div>'); }else { try { if (window.external.msIsSiteMode()) { jQuery.get('https://www.developer.comlatest_articles', function(data){ displayLatestNews(data); }); } } catch (ex) { } } }else{ document.write('<div id="pinMeContainer"><img class="msPinSite" src="/images0/developer64x64.png" height="64" weight="64" /><br/><span id="pinMe">Upgrade your browser to IE 9 to see the power of Site Pinning!</span></div>'); } } function displayLatestNews(data){ try{ g_ext = window.external; if(data.articles != undefined && data.articles.length){ g_ext.msSiteModeClearJumpList(); g_ext.msSiteModeCreateJumplist('Developer.com Latest News'); for(i=0; i<data.articles.length; i++){ g_ext.msSiteModeAddJumpListItem (data.articles[i].title, data.articles[i].link, 'https://www.developer.comfavicon.ico'); } var dt = new Date(); var updated = (dt.getMonth()+1) +"/"+(dt.getDay()+1)+"/"+dt.getFullYear()+" "+dt.toLocaleTimeString(); g_ext.msSiteModeAddJumpListItem ('Last updated - '+updated, 'https://www.developer.com', 'https://www.developer.com/images0/refresh.ico'); g_ext.msSiteModeShowJumpList(); } }catch(ex){ } } </script> --> <!-- End of code to put on site page to show pinning option --> <div class="adsBox"> <!-- QS-AD: 'imu' start --> <script language="JavaScript"> var t=displayDFPTag("imu"); document.write(t); </script> <!-- QS-AD: 'imu' end --> </div> <div class="vspace"></div> <div id="mostCommentedOn" class="section"> <div class="sectionHeader"> <h2>Most Commented On</h2> <a href="#" class="more"></a> </div> <div class="sectionContent"> <div class="tabs"> <div class="tabsMenu clearfix"> <ul> <li><a href="#mostCommentedOnThisWeek" class="selected">This Week</a></li> <li><a href="#mostCommentedOnThisMonth">This Month</a></li> <li><a href="#mostCommentedOnAllTime">All-Time</a></li> </ul> </div> <div class="tabsContents"> <div class="tabsContent selected" id="mostCommentedOnThisWeek"> <ul> <li><a href="http://www.developer.com/article.php/3896056"><span class="graytext">1</span> 10 Experimental PHP Projects Pushing the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Envelope</a></li><li><a href="http://www.developer.com/article.php/777761"><span class="graytext">2</span> Day 1: Learning the Basics of PL/SQL</a></li><li><a href="http://www.developer.com/article.php/3336751"><span class="graytext">3</span> C# Tip: Placing Your C# Application in the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System Tray</a></li><li><a href="http://www.developer.com/article.php/641521"><span class="graytext">4</span> Logical Versus Physical Database Modeling</a></li><li><a href="http://www.developer.com/article.php/3896711"><span class="graytext">5</span> Is Ubuntu Contributing as Much as It Should to<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free Software Projects?</a></li> </ul> </div> <div class="tabsContent" id="mostCommentedOnThisMonth"> <ul> <li><a href="http://www.developer.com/article.php/777761"><span class="graytext">1</span> Day 1: Learning the Basics of PL/SQL</a></li><li><a href="http://www.developer.com/article.php/3894316"><span class="graytext">2</span> The 5 Developer Certifications You'll Wish You<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Had in 2015</a></li><li><a href="http://www.developer.com/article.php/3896056"><span class="graytext">3</span> 10 Experimental PHP Projects Pushing the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Envelope</a></li><li><a href="http://www.developer.com/article.php/1495931"><span class="graytext">4</span> An Introduction to Struts</a></li><li><a href="http://www.developer.com/article.php/3894566"><span class="graytext">5</span> Inside Facebook's Open Source Infrastructure</a></li> </ul> </div> <div class="tabsContent" id="mostCommentedOnAllTime"> <ul> <li><a href="http://www.developer.com/article.php/2109801"><span class="graytext">1</span> Creating Use Case Diagrams</a></li><li><a href="http://www.developer.com/article.php/777761"><span class="graytext">2</span> Day 1: Learning the Basics of PL/SQL</a></li><li><a href="http://www.developer.com/article.php/3336751"><span class="graytext">3</span> C# Tip: Placing Your C# Application in the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System Tray</a></li><li><a href="http://www.developer.com/article.php/3096831"><span class="graytext">4</span> Using ASP.NET To Send Email</a></li><li><a href="http://www.developer.com/article.php/3417381"><span class="graytext">5</span> Using JDBC with MySQL, Getting Started</a></li> </ul> </div> </div> </div> </div> </div> <div class="vspace"></div> <div class="articlecategorysummary"> <iframe id='whitePaperIFrame' scrolling="no" frameborder="0" align="middle" src="https://www.developer.com/sl/assetlisting/?wsn=www.developer.com&amp;wpu=/net/asp/article.php/10917_602621_3/Writing-Active-Server-components-in-Visual-Basic.htm&amp;lurl=https://o1.qnsr.com/cgi/r?WT.qs_dlk=W1UaYArIZ7wAAGtYeX8AAAAO;;n=203;c=1397070;s=9487;x=7936;f=201309171321110;u=j;z=TIMESTAMP;k=https://assetform.developer.com/controller&amp;wpos=AssetListing&amp;lyt=l9&amp;title=Top White Papers and Webcasts&css=https://www.developer.com/hqb2b/css/qmp/qmp_default.css" height="725"></iframe> </div> <script type="text/javascript"> var updateIframe = false; var t = 0; function updateQMPIframe() { if(!updateIframe) { if($('#whitePaperIFrame').contents().find('.asset').length > 0) { var height = $('#whitePaperIFrame').contents().find('.qmpContainer').height(); var iframe = document.getElementById('whitePaperIFrame'); var iframeHeight = document.getElementById('whitePaperIFrame').height; if(height>iframeHeight){ height = height + 5; //Add border pixels. iframe.setAttribute( 'height', height); clearTimeout(t); updateIframe = true; } } else { t = setTimeout('updateQMPIframe()', 3000); } } } updateQMPIframe(); </script> </div> <div class="vspace clear"></div> <div class="vspace clear"></div> <div style="clear:both;"> <div style="text-align: center;"> <div id="lb-wrapper" align="center"> <div id="ad_p2-lb" style="text-align:center;"> <!-- QS-AD: 'lb' start --> <script language="JavaScript"> var t=displayDFPTag("lb"); document.write(t); </script> <!-- QS-AD: 'lb' end --> </div> </div> </div> <div align="center"> <a href="/sitemap.html">Sitemap</a> </div> <br/> <FONT SIZE="-1" FACE="arial, helvetica"> <style type="text/css"> #developerBrand-footer{text-align:center;margin:0 auto} #footerlinks{font-size:12px;word-spacing:1px} #footerlinks a{color:#000;margin:5px 0 0} #itbeBrand-footer{text-align:center;margin:0 auto} #itbusinessedge-footer{text-align:center;margin:0 auto} #footercopyright{font-size:12px;margin:5px 0 0} #developerBrandForum-footer{text-align:center;margin:0 auto} #itbeBrandForum-footer{text-align:center;margin:0 auto} #eweek-truste-footer{text-align:center;margin:0 auto} #developerBrand-truste-footer{text-align:center;margin:0 auto} #itbeBrand-truste-footer{text-align:center;margin:0 auto} #weboitbeBrand-truste-footer{text-align:center;margin:0 auto} #itbusinessedge-truste-footer{text-align:center;margin:0 auto} .footerLogoClass{text-align:center;margin:0 auto} </style> <div id="developerBrand-footer" style="display:none"></div> <div id="itbeBrand-footer" style="display:none"></div> <div id="itbusinessedge-footer" style="display:none"></div> <div id="zde-footer" style="display:none" class="footerLogoClass"></div> <div id="baseline-footer" style="display:none" class="footerLogoClass"></div> <div id="cinsider-footer" style="display:none" class="footerLogoClass"></div> <div id="cioinsight-footer" style="display:none" class="footerLogoClass"></div> <div id="eweek-footer" style="display:none" class="footerLogoClass"></div> <div id="enterpriseappstoday-footer" style="display:none" class="footerLogoClass"></div> <div id="eseminar-footer" style="display:none" class="footerLogoClass"></div> <div id="wbg-footer" style="display:none" class="footerLogoClass"></div> <div id="developerBrandForum-footer" style="display:none"></div> <div id="itbeBrandForum-footer" style="display:none"></div> <div id="eweek-truste-footer" style="display:none" class="footerLogoClass"></div> <div id="developerBrand-truste-footer" style="display:none"></div> <div id="itbeBrand-truste-footer" style="display:none"></div> <div id="weboitbeBrand-truste-footer" style="display:none"></div> <div id="itbusinessedge-truste-footer" style="display:none"></div> <script async language="Javascript" src="/icom_includes/footers/scripts/footerbrandingcode.js"> </script> </font> <link href='https://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext' rel='stylesheet' type='text/css'> <div id="newuserregistrationpopup"> <div id="closepopup"><a class="newuserregistrationpopup-sprite close" href="#"></a></div> <div id="thankuptext">Thanks for your registration, follow us on our social networks to keep up-to-date</div> </div> </div> </div> </div> </div> <!-- QS-AD: 'hero' start --> <script language="JavaScript"> var t=displayDFPTag("hero"); document.write(t); </script> <!-- QS-AD: 'hero' end --><script language="JavaScript" type="text/javascript"> <!-- // Make sure all image has an alt tag if it doesn't already $(document).ready(function(){ $("img").each(function() { var img = $(this); if (!img.attr("alt")) img.attr("alt", ""); }); }); //--> </script> <!-- QS-AD: 'siteskin' start --> <script language="JavaScript"> var t=displayDFPTag("siteskin"); document.write(t); </script> <!-- QS-AD: 'siteskin' end --></body> </html>