奇怪的问题。我需要使用带有ID的JavaScript数组,从数据库中获取更多信息,并使用ID作为行ID。ASP相当于Ajax?
我需要再使用此附加信息,并将其发送给使用Ajax另一个文件(CSS),然后将利用这些信息来旋转图像。
除非我可以在同一文件中使用ASP经典,和ASP.NET(C#)? - 或者我可以使用或多或少相同的ASP代码来访问我的数据库?
旋转脚本
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Web" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
//string url = Request.QueryString["url"];
string url = @"C:\inetpub\wwwroot\testing\image.jpg";
string rotate_dir = Request.QueryString["dir"];
//create an image object from the image in that path
System.Drawing.Image img = System.Drawing.Image.FromFile(url);
//Rotate the image in memory
if (rotate_dir == "clockwise")
{
//Rotate clockwise
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
} else if (rotate_dir == "anticlockwise")
{
//Rotate anti-clockwise
img.RotateFlip(RotateFlipType.Rotate90FlipXY);
}
//Delete the file so the new image can be saved
System.IO.File.Delete(url);
//save the image to the file
img.Save(url);
//release image file
img.Dispose();
}
</script>
我用它来访问我的数据库
'Create connection and load users database
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.ACE.OLEDB.12.0"
conn.Open Server.MapPath("/nightclub_photography/data/database/jamsnaps.mdb")
希望你明白我想要做什么?
对不起,不,对我没有意义。我看到你旋转图像,Asp Classic与此有什么关系?数据库是什么? –
@HanletEscaño我觉得他没有得到这样的Asp.NET还支持ACCESS或旧格式的数据库连接,并认为他必须使用ASP的经典之作datafetching :( – Vogel612