asp-classic

Classic ASP Authenticate Against Active Directory

旧时模样 提交于 2020-01-02 07:13:44
问题 I have a Classic ASP website (sorry!). Some parts of it need to be NT authentication enabled. I would ideally like to present the user with a nice login form (rather than a browser prompt) which I then authenticate against AD and then do the usual "log in if success, show error if failure" Is this even possible? I've tried the following on a local computer but not sure how to properly test for success or if it even expands to searching against AD <html> <head> </head> <body> <form action=

SQL Injection Prevention

倖福魔咒の 提交于 2020-01-02 06:19:13
问题 I'm currently working on a legacy ASP project where security has now become a large concern. Not only is it insecure encryption methods (md5), but I'm worried about SQL injection problems. I'm not very good with injection quite yet, and I've tried only the basics of what I know. I've found the function which "secures" any user input, but I'm wondering if it is actually doing anything to prevent injection attacks. Here is the function: function sqlfix(input) if not isnull(input) and input <> "

classic asp/asp.net website - global.asa not working

为君一笑 提交于 2020-01-02 03:39:17
问题 I've recently been given a website written in classic asp to configure and set up - although it also appears to have pages written in asp.net. The problem I'm having at the moment is that it doesn;t appear to be picking up settings from the global.asa file such as Application("ConnectionString").... As when I try to write them out from somewhere in the code - nothing appears. Any idea how to congure this website to use global.asa...or why it's not already using it? There is web.config file

IIS7 - Specifying content-length header in ASP causes “connection reset” error

百般思念 提交于 2020-01-02 02:54:04
问题 I'm migrating a series of websites from an existing IIS5 server to a brand new IIS7 web server. One of the pages pulls a data file from a blob in the database and serves it to the end user: Response.ContentType = rs("contentType") Response.AddHeader "Content-Disposition", "attachment;filename=" & Trim(rs("docName"))&rs("suffix")' let the browser know the file name Response.AddHeader "Content-Length", cstr(rs("docsize"))' let the browser know the file size Testing this in the new IIS7 install,

Classic ASP - how to save data to CSV file with UTF-8

对着背影说爱祢 提交于 2020-01-01 18:20:52
问题 I have the following code: output = ... (some comma-separated data) Response.Clear 'Response.ChartSet = "UTF-8" 'Response.CodePage = 65001 Response.ContentType = "text/csv" Response.AddHeader "Content-Disposition", "filename=myfile.csv;" Response.Write(output) Response.End Now, everything is working just fine with having the data itself and generating a virtual CSV file for direct download, but if I have a non-ascii data in one or more of the fields (columns), I don't get it in UTF-8 in the

Classic ASP SQL Server Database Connection

岁酱吖の 提交于 2020-01-01 10:28:07
问题 I am aiming to create a very basic web based DBMS for Microsoft SQL Server. However, in order to connect to a SQL Server database you seem to require a ODBC connection on the server. Is there any possible way to overcome this? 回答1: You haven't stated which version of SQLServer but you can use OLEDB connection in ASP. <% Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = Northwind; User Id = sa; Password=" If conn

Can I combine asp.net 4.0 with classic asp, or can I convert classic asp to asp.net?

半城伤御伤魂 提交于 2020-01-01 10:04:44
问题 I have a website made with Visual Studio 2010 / .net 4 / VB. I really liked the layout of a FAQ system I found because it's simple, but it's in classic asp. So, obviously, I cannot include my master page layouts, but I guess that's okay. But can I convert the FAQ system to asp.net, or is there some tool out there I can utilize? If not, is it okay to have classic asp pages on a asp.net 4.0 website? Any guidance would be truly appreciated! 回答1: I would be better if you convert classic ASP pages

Getting environment variables in Classic ASP

£可爱£侵袭症+ 提交于 2020-01-01 08:22:27
问题 How can I get the value of a custom environment variable in a classic ASP page using VBScript? 回答1: You can use the ExpandEnvironmentStrings method of the WScript.Shell object to retrieve environment variables. The following code will assign the value of the PATH environment variable to var myPath: set foo = createobject("WScript.Shell") myPath = foo.ExpandEnvironmentStrings("%PATH%") More info on the Shell object as MSDN Edit: Had to change the variable to which the shell object is assigned.

Identify if request is coming from local network (intranet)

房东的猫 提交于 2019-12-31 23:00:30
问题 I need to identify if a request comes from Internet or Intranet using either client-side or server-side. The problem I'm trying to solve is: our web site can be accessed from internet and intranet. The intranet user (user inside company), does not have access to internet. We are using Google Anylitics, when intranet user access the page, the page take so long to upload because it tries to download (ga) JavaScript file generated from Google. Any solution? 回答1: You can check the ip address of a

Identify if request is coming from local network (intranet)

安稳与你 提交于 2019-12-31 23:00:12
问题 I need to identify if a request comes from Internet or Intranet using either client-side or server-side. The problem I'm trying to solve is: our web site can be accessed from internet and intranet. The intranet user (user inside company), does not have access to internet. We are using Google Anylitics, when intranet user access the page, the page take so long to upload because it tries to download (ga) JavaScript file generated from Google. Any solution? 回答1: You can check the ip address of a