0

我有一个已发布并在服务器中运行的 Web 应用程序。我有aspx文件,但没有.vb文件。我需要在应用程序中编辑单个页面。如何访问.vb文件?或者更好地说,我怎样才能在应用程序中编辑我想要的部分?

编辑: 这是我的 aspx 文件:

<%@ page language="VB" autoeventwireup="false" inherits="UrunRapor, App_Web_hfev-r-q" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %><%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v8.3, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3.Export, Version=8.3.6.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dxwgv" %>


<!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>Ürün Detaylı Rapor</title>
    <script language="javascript">
            window.moveTo(0, 0);
            window.resizeTo(screen.availWidth, screen.availHeight);
        </script>    
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="font-size: 9pt; width: 474px; font-family: Calibri">
            <tr>
                <td style="width: 100px; height: 22px">
                    Ay</td>
                <td style="width: 100px; height: 22px">
                    <asp:DropDownList ID="cboMonth" runat="server" BackColor="#FFFFC0" Font-Bold="True"
                        Font-Names="Calibri" Font-Size="9pt">
                        <asp:ListItem Selected="True" Value="%%">[..]</asp:ListItem>
                        <asp:ListItem Value="1">January</asp:ListItem>
                        <asp:ListItem Value="2">February</asp:ListItem>
                        <asp:ListItem Value="3">March</asp:ListItem>
                        <asp:ListItem Value="4">April</asp:ListItem>
                        <asp:ListItem Value="05">May</asp:ListItem>
                        <asp:ListItem Value="06">June</asp:ListItem>
                        <asp:ListItem Value="07">July</asp:ListItem>
                        <asp:ListItem Value="08">August</asp:ListItem>
                        <asp:ListItem Value="09">September</asp:ListItem>
                        <asp:ListItem Value="10">October</asp:ListItem>
                        <asp:ListItem Value="11">November</asp:ListItem>
                        <asp:ListItem Value="12">December</asp:ListItem>
                    </asp:DropDownList></td>
                <td style="width: 100px; height: 22px">
                    Yıl
                </td>
                <td style="width: 100px; height: 22px">
                    <asp:DropDownList ID="cboYear" runat="server" BackColor="#FFFFC0" Font-Bold="True"
                        Font-Names="Calibri" Font-Size="9pt">
                        <asp:ListItem Selected="True" Value="%%">[..]</asp:ListItem>
                        <asp:ListItem Value="2007">2007</asp:ListItem>
                        <asp:ListItem Value="2008">2008</asp:ListItem>
                        <asp:ListItem Value="2009">2009</asp:ListItem>
                        <asp:ListItem Value="2010">2010</asp:ListItem>
                        <asp:ListItem>2011</asp:ListItem>
                        <asp:ListItem>2012</asp:ListItem>
                        <asp:ListItem>2013</asp:ListItem>
                        <asp:ListItem>2014</asp:ListItem>
                        <asp:ListItem>2015</asp:ListItem>
                    </asp:DropDownList></td>
                <td style="width: 100px; height: 22px">
                    <asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="9pt"
                        Text="Sorgula" /></td>
                <td style="width: 100px; height: 22px">
                    <asp:Button ID="Button2" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="9pt"
                        Text="Excel'e aktar" /></td>
                <td style="width: 100px; height: 22px">
                    <asp:Button ID="Button3" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="9pt"
                        Text="PDF dosyasına aktar" Width="123px" /></td>
            </tr>
        </table>

    </div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CRRConnectionString %>">
            <SelectParameters>
                <asp:ControlParameter ControlID="cboMonth" Name="Month" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="cboYear" Name="Year" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
        <dxwgv:aspxgridview id="dgCRR" runat="server" datasourceid="SqlDataSource1">
<Settings ShowFilterRow="True" ShowFilterRowMenu="True" ShowFilterBar="Visible" 
                ShowGroupedColumns="True" ShowGroupPanel="True"></Settings>

<SettingsPager Visible="False" PageSize="1000" Position="TopAndBottom"></SettingsPager>
</dxwgv:aspxgridview>
        <dxwgv:ASPxGridViewExporter ID="ToExcel" runat="server">
        </dxwgv:ASPxGridViewExporter>
    </form>
</body>
</html>

她是我想使用的 .vb 文件

Imports System.Globalization
Partial Class UrunRapor
    Inherits CRR.RequestBase
    Dim SelCmd As String
    Dim MyUser As String
    Dim dtreg As Data.DataTable

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        MyUser = Request.ServerVariables.Get("LOGON_USER")
        If Not Page.IsPostBack Then
            Dim dareg As Data.SqlClient.SqlDataAdapter = New Data.SqlClient.SqlDataAdapter
            dareg.SelectCommand = select_User(Request.ServerVariables.Get("LOGON_USER"))
            dareg.SelectCommand.Connection = cnn
            dtreg = New Data.DataTable
            dareg.Fill(dtreg)
            If dtreg.Rows.Count = 0 Then
                Response.Redirect("NotAuthRep.aspx")
            End If
            'Exit Sub
            'dgCRR.DataBind()
        End If
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        FillGrid()
    End Sub


    Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
        FillGrid()
        ToExcel.FileName = "CRR-Product.pdf"
        ToExcel.WritePdfToResponse("CRR-Product.pdf")
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        'ToExcel.FileName = "CRRNew"
        'ToExcel.DataBind()
        FillGrid()
        ToExcel.GridViewID = "dgCRR"
        ToExcel.WriteXlsToResponse()
    End Sub
    Protected Sub FillGrid()
        SelCmd = "SELECT  tblCRRProductDetails.CRRId, tblCRRProductDetails.ProductCode, tblCRRProductDetails.ProductName, tblCRRProductDetails.Batch, tblCRRProductDetails.ExpireDate, tblCRRProductDetails.Qty, tblCRRProductDetails.SalesUnit, tblCRR.CrrCaptureDate, tblCRR.RegistrarName, tblCRR.CustomerCode, tblCRR.CustomerName, tblCRR.Channel, tblCRR.ClaimerName, tblCRR.ClaimerAddress, tblCRR.ClaimerPhone, tblCRR.ClaimerMail, tblCRR.CaseDetails, tblCRR.RsDeptName, tblCRR.ReasonName, tblCRR.RsPerName, tblCRR.ExpecRsDay, tblCRR.ExpecRsDate, tblCRR.RsDescription, tblCRR.ResolutionDate, tblCRR.ClaimResult, tblCRR.ActionPlan, tblCRR.ClosedPerName, tblCRR.ClosingDate,tblCRR.Status FROM tblCRRProductDetails INNER JOIN tblCRR ON tblCRRProductDetails.CRRId = tblCRR.CrrID WHERE (MONTH(CrrReceiveDate) LIKE '" & cboMonth.SelectedItem.Value & "') AND (YEAR(CrrReceiveDate) LIKE '" & cboYear.SelectedItem.Value & "')"
        SqlDataSource1.ConnectionString = "My Connection String"
        SqlDataSource1.SelectCommand = SelCmd
        dgCRR.DataBind()
    End Sub
End Class
4

3 回答 3

2

当您发布站点时,编译后的版本会发布在服务器上,而不是代码文件。您需要 Disassembler / Decompiler 来反编译 dll 文件。他们之中有一些是

  1. .Net 反射器
  2. ILSpy (免费)
  3. 点窥 (免费)
于 2013-05-07T07:35:52.150 回答
2

您可以做的是更改 ASPX,例如,而不是这个:

<%@ Page Language="C#" CodeBehind="MyPage.aspx.cs" Inherits="MyNamespace.MyPage" %>

你可以这样改变它:

<%@ Page Language="C#" Inherits="MyOtherNamespace.MyNewPage" %>

在新的 MyOtherNamespace.MyNewPage 类(至少应从 System.Web.UI.Page 派生)中编写新行为,您可以将其放入部署在bin目录中的任何 .DLL 程序集中。

您还可以从原始页面派生这个新类(仅引用原始程序集),而不是仅从 System.Web.UI.Page 派生,如果派生是您的选项,具体取决于您需要做的更改。

否则,您将不得不使用 .NET Reflector 或 ILSpy 等工具重新构建原始代码来构建这个新类,但至少,您不必触及现有的已编译程序集。

于 2013-05-07T07:43:03.317 回答
0

您可以尝试使用ilasmIL 直接对其进行反汇编和编辑,但我认为实际上您将很难在没有源代码的情况下进行任何更改。.cs 文件是源文件。只有编译好的 IL 文件在已发布的站点上可用。您需要找出是谁发布了它,并与他们讨论获取来源。

于 2013-05-07T07:37:09.903 回答