这是我第一次发帖,我非常绝望。我已经研究过所有地方甚至我的教科书来解决我的问题,并且在试图解决这个错误的20小时(分开3天之后)后出现空洞。以下是在调试时尝试访问我的某个页面时代码在网页上显示的确切文本。
` '/ MyApp'应用程序中的服务器错误。 编译错误 描述:编译服务此请求所需的资源时发生错误。请查看以下特定错误详细信息并适当修改源代码。
编译器错误消息:BC30455:未为参数'description'指定'Public Sub New(描述为String,quanity As Integer)'。
来源错误:
Line 52: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 53: Public Sub New()
Line 54: MyBase.New
Line 55: Dim dependencies() As String
Line 56: CType(Me,Global.FinalProject.WebForm3).AppRelativeVirtualPath = "~/PlasticWorms.aspx"
Source File: C:\Users\christopher\AppData\Local\Temp\Temporary ASP.NET Files\myapp \4b7a0ffe\8a9f18fa\App_Web_plasticworms.aspx.cdcab7d2.9_c0ynxq.0.vb Line: 54
显示详细的编译器输出:
显示完整编译源:
版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.34009
公共类显示
Dim _customerFirstName As String
Dim _customerLastName As String
Dim _customerAddress As String
Dim _description As String = ""
Dim intQuanity As Integer = 0
Dim decCustomerID As Decimal = 0D
Dim customerInfo(3) As String
Dim price As Decimal
Dim decTotal As Decimal
Dim _result As String
Dim form4 As WebForm4
Dim form3 As WebForm3
Dim sale As Sale
Sub New()
MyBase.New()
End Sub
Sub prints()
sale = New Sale(decTotal)
form4 = New WebForm4(customerInfo(0), customerInfo(1), customerInfo(2), CDec(customerInfo(3)))
form3 = New WebForm3(_description, intQuanity)
For Each S As String In customerInfo
_result = " , " & vbNewLine & S
Next
_result = " , " & vbNewLine & _description & " , " & vbNewLine & decTotal
form4.Result(_result)
End Sub
结束班
Public Class SaveData
Dim _customerFirstName As String
Dim _customerLastName As String
Dim _customerAddress As String
Dim _description As String = ""
Dim intQuanity As Integer = 0
Dim decCustomerID As Decimal = 0D
Dim price As Decimal
Dim total As Decimal
Dim _result As String
Dim strFileLocation As String = "D:\Sales.txt"
Dim form4 As WebForm4
Dim form3 As WebForm3
Sub New()
MyBase.New()
End Sub
Sub save()
form4 = New WebForm4(_customerFirstName, _customerLastName, _customerAddress, decCustomerID)
form3 = New WebForm3(_description, intQuanity)
Try
Dim objWriter As IO.StreamWriter = _
IO.File.AppendText(strFileLocation)
objWriter.Write("ID: " & decCustomerID & ",")
objWriter.Write("Customer First Name: " & _customerFirstName & ",")
objWriter.Write("Customer Last Name: " & _customerLastName & ",")
objWriter.Write("address: " & _customerAddress & ",")
objWriter.Write("Purchase Description: " & _description & ",")
objWriter.Write("Total: " & total & ",")
objWriter.Close()
Catch ex As Exception
MsgBox("Log file could not be written. Please Check that you have an E:\ drive on you're computer.")
End Try
Try
Catch ex As Exception
End Try
End Sub
结束班
公共类销售
Dim _customerFirstName As String
Dim _customerLastName As String
Dim _customerAddress As String
Dim _description As String = ""
Dim intQuanity As Integer = 0
Dim decCustomerID As Decimal = 0D
Dim price As Decimal
Dim decTotal As Decimal
Dim _result As String
Sub New(ByVal total As Decimal)
total = decTotal
End Sub
Sub Calculate()
price = 3.99D
decTotal = intQuanity * price
End Sub
结束班
公共类WebForm4 继承System.Web.UI.Page
Dim _customerFirstName As String
Dim _customerLastName As String
Dim _customerAddress As String
Dim _description As String = ""
Dim intQuanity As Integer = 0
Dim decCustomerID As Decimal = 0D
Dim price As Decimal
Dim decTotal As Decimal
Dim _result As String
Dim sale As Sale
Dim display As New Display
Dim saveData As New SaveData
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnPlaceOrder_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPlaceOrder.Click
sale = New Sale(decTotal)
_customerFirstName = txtFirstName.Text
_customerLastName = txtLastName.Text
_customerAddress = txtAddress.Text
sale.Calculate()
saveData.save()
display.prints()
VBMath.Randomize(decCustomerID)
End Sub
Sub New(ByVal customerFirstName As String, ByVal customerLastName As String, ByVal customerAddress As String, ByVal customerID As Decimal)
MyBase.New()
customerID = decCustomerID
customerFirstName = _customerFirstName
customerLastName = _customerLastName
customerAddress = _customerAddress
End Sub
Sub Result(ByVal result As String)
lblResult.Text = result
Calendar1.SelectedDate.Day.Equals(Calendar1.TodaysDate.AddDays(3))
End Sub
结束班
公共类WebForm3 继承System.Web.UI.Page
Dim _description As String = ""
Dim intQuanity As Integer = 0
Sub New(ByVal description As String, ByVal quanity As Integer)
MyBase.New()
description = _description
quanity = intQuanity
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnCheckOut_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCheckout.Click
If chkBlue.Checked = True Then
_description += " , " & chkBlue.Text
intQuanity += CInt(txtBlueQty.Text)
ElseIf chkBrown.Checked = True Then
_description += " , " & chkBrown.Text
intQuanity += CInt(txtBrownQty.Text)
ElseIf chkCrawDad.Checked = True Then
_description += " , " & chkCrawDad.Text
intQuanity += CInt(txtCrawdadQty.Text)
ElseIf chkMud.Checked = True Then
_description += " , " & chkMud.Text
intQuanity += CInt(txtMudQty.Text)
ElseIf chkPurple.Checked = True Then
_description += " , " & chkPurple.Text
intQuanity += CInt(txtPurpleQty.Text)
ElseIf chkPurpleSpeckled.Checked = True Then
_description += " , " & chkPurpleSpeckled.Text
intQuanity += CInt(txtPurpleSpeckledQty.Text)
ElseIf chkRedDeath.Checked = True Then
_description += " , " & chkRedDeath.Text
intQuanity += CInt(txtRedDeathQty.Text)
ElseIf chkSpeckledGray.Checked = True Then
_description += " , " & chkSpeckledGray.Text
intQuanity += CInt(txtSpeckledGrayQty.Text)
ElseIf chkTan.Checked = True Then
_description += " , " & chkTan.Text
intQuanity += CInt(txtTanQty.Text)
ElseIf chkWatermellon.Checked = True Then
_description += " , " & chkWatermellon.Text
intQuanity += CInt(txtWatermellonQty.Text)
ElseIf chkYellowGreen.Checked = True Then
_description += " , " & txtYellowGreenQty.Text
intQuanity += CInt(txtYellowGreenQty.Text)
Else
MsgBox("ERROR")
End If
Server.Transfer("OrderRecipt.aspx")
End Sub
结束课程 `