在 Web 开发中正确使用类
本文关键字:Web 开发 | 更新日期: 2023-09-27 18:37:27
我曾经编写过winforms,现在我正在尝试将我的一些应用程序移植到Web界面,但是我的应用程序似乎无法正常工作,尽管我的类中的代码没有改变。
我从来没有做过网络开发,所以我想知道这是否是我做得不对的事情?
我在我的runEbay中使用此代码.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="runEbay.aspx.cs" Inherits="eBay_Item_Scanner.runEbay" %>
<div>
<a href="Default.aspx">Home</a> | <a href="runEbay.aspx">Run Full eBay Scan WARNING!!!!!!!
</a>
</div>
<%
string MAINPN = Request["MAINPN"] != null ? Request["MAINPN"] : "";
string EBAYCATEGORYTOSCAN = Request["EBAYCATEGORYTOSCAN"] != null ? Request["EBAYCATEGORYTOSCAN"] : "";
Response.Write("<br>MAINPN: " + MAINPN);
Response.Write("<br>EBAYCATEGORYTOSCAN: " + EBAYCATEGORYTOSCAN);
//create instance of class Program
eBay_Item_Scanner.Program eb = new eBay_Item_Scanner.Program();
if (SUBPN.Length > 0)
{
String query = @"my query using some request parameters";
//call functions from another class
eb.getEbay_com_API(query, EBAYCATEGORYTOSCAN);
}
Response.Write("<br><br>Scanning is done");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
好的;问题是我的函数太大了,它们使IIS超时。我删除了超时,这解决了问题。