asp-classic

classic asp calling an api using addheader for authorization

陌路散爱 提交于 2021-02-04 08:33:05
问题 I have a page that calls an api that in test mode has not required any authorization. We are now moving to a live environment where a username and password will be required. The api provider has sent the following message: To access these services please send the requests by adding following HTTP header. Authorization: Basic Base64Encode(“username: password”) I'm not sure of the correct syntax and wondered if someone could help me out. The original call (and working perfectly) is: Dim xmlobj,

“Could not load file or assembly” Error Com-Enabled .Net Assembly

情到浓时终转凉″ 提交于 2021-01-29 17:41:58
问题 Currently, I am stuck with a classic asp project, that needs to call a .Net Assembly. It was working, until the customer had to wipe their server. I was able to reregister the .Net Assembly, but I get this error during runtime: MyDll error '80070002' Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. Here is the asp code, not sure if it will help. set Inst =

Request.ServerVariables(“..”) returns undefined when assigned to a variable yet its value can be displayed via Response.Write(“..”)

ε祈祈猫儿з 提交于 2021-01-29 12:22:08
问题 I am trying to retrieve the user's IP address and assign it to a variable: var ipAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR") || Request.ServerVariables("REMOTE_ADDR") || Request.ServerVariables("HTTP_HOST"); Response.Write(Request.ServerVariables("HTTP_HOST") + "<br />\n\n"); // produces "localhost" Response.Write(Request.ServerVariables("REMOTE_ADDR") + "<br />\n\n"); // produces "::1" Response.Write(Request.ServerVariables("HTTP_X_FORWARDED_FOR") + "<br />\n\n"); // produces

IIS 10 and Custom Error Pages-Executing Twice

落爺英雄遲暮 提交于 2021-01-28 12:45:18
问题 In response to the infamous "xmlrpc.php" DOS attacks, I wrote custom error ASP pages for both the 404 and the 500-100 type of errors and got most of it working okay. However, I found that the pages are being executed twice, for unknown reason. They both send emails, and also collect the client's IP, for automatic adding to a Peerblock custom IP block list text file. However, because of the double-execution, two (2) emails are sent, and the IP addresses are added twice to the Peerblock text

IIS 10 and Custom Error Pages-Executing Twice

房东的猫 提交于 2021-01-28 12:42:50
问题 In response to the infamous "xmlrpc.php" DOS attacks, I wrote custom error ASP pages for both the 404 and the 500-100 type of errors and got most of it working okay. However, I found that the pages are being executed twice, for unknown reason. They both send emails, and also collect the client's IP, for automatic adding to a Peerblock custom IP block list text file. However, because of the double-execution, two (2) emails are sent, and the IP addresses are added twice to the Peerblock text

Can't run classic ASP page on Windows 10 even after installing ASP support via “Turn Windows features on or off”

瘦欲@ 提交于 2021-01-28 06:41:59
问题 I get this error: An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error. But I already installed classic ASP support on my IIS; why would I be getting this error? I tried restarting IIS and that didn't help; just in case the error message came from the application itself, I searched for it but didn't find it in the code anywhere. 回答1: to see the classic asp error

Using SQL parameters returns “Arguments are of the wrong type”

时光毁灭记忆、已成空白 提交于 2021-01-28 06:31:26
问题 I am having some trouble figuring out how to write classic ASP queries to prevent SQL injection. I have read a few posts on it and have come up with the following script; set cmd = server.createobject("ADODB.Command") SQL = "Select * From tablename Where Email Like ? And Deleted=0" cmd.ActiveConnection = conn cmd.CommandText = qText cmd.CommandType = adCmdText cmd.CommandTimeout = 900 cmd.Parameters.Append cmd.CreateParameter("@name", adVarchar, adParamInput, 50, "%" & this.Form("email") & "%

ASP Upload Component - Classic ASP

白昼怎懂夜的黑 提交于 2021-01-27 23:51:41
问题 I have just moved a site from a dedicated server to a GoDaddy shared hosting account, and have just encountered loads of problems! One being with ASP Upload. In Classic ASP, this is what I would normally do to upload files to my folder: Set upload = Server.CreateObject("Persits.Upload") uploadPath = Server.MapPath("../../files/photos/"&token_&"/") upload.IgnoreNoPost = True upload.Save(uploadPath) Set upload = Nothing But since moving to GoDaddy, I get this nasty message: This feature has

Base64 Encode a ZIP file using Classic ASP and VB Script

混江龙づ霸主 提交于 2021-01-27 18:31:32
问题 I have a zip file, which contains one CSV file. I need to Base64 encode this zip file to send to eBay (using their API). I used this website: http://www.opinionatedgeek.com/DotNet/Tools/Base64Encode/ which works nicely, I upload my zip file and it returns a base64 encoded string which eBay likes. I need to do what this website does, but using Classic ASP and VB Script. I already have a base64 encode function, from here: http://www.motobit.com/tips/detpg_base64encode/ so I don't need a script

How to delay a response in Classic ASP

僤鯓⒐⒋嵵緔 提交于 2021-01-27 03:56:34
问题 I have a site running Classic-ASP and on the login page I would like to delay the response to a failed login attempt (by like 10 seconds) to help prevent brute force attacks on accounts. Quick google searches show some hacks using SQL server queries that seem hack-tastic. Is there a good way to do this in classic asp? 回答1: I am not going to answer your specific question, as many have already done so, but there are far better ways of preventing brute force attacks. For instance: Why not lock a