PDA

View Full Version : سوال: کار نکدرن کلاس WebClient بر روی هاست



arman_Delta2002
دوشنبه 15 اردیبهشت 1393, 16:21 عصر
سلام خدمت دوستان عزیز
من برای اولین بار خیر سرم اومدم ASP بنویسم ولی همین اول کاری به این مشکل خوردم که یک صفحه اینترنتی رو میگیرم بعد کل اش رو دانلود میکنم به صورت بایت و بایت رو به رشته تبدیل میکنم میریزم تو یک متقییر رشته ای
مشکل اینجاست که در حالت لوکال درست کار میکنه و متقییره کل صفحه رو دانلود میکنه و میریزه تو متقییر رشته ای ولی وقتی رو هاست اپلود میکنم کار نمیکه !
نه خطا میده نه متقییر من رو پر میکنه !
ایا دستور خواصی رو باید تو وب کانفیگ بزنم؟

http://explorer2.somee.com/calc/

پیج هدر



<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" ValidateRequest="false" %>



Dim content As String = ""
Dim WebClient1 As New WebClient
Dim Bity() As Byte = Nothing
' Dim WebRequest As System.Net.WebRequest = WebRequest.Create(TextBoxProfileLink.Text)
' Dim webResponse As System.Net.WebResponse = WebRequest.GetResponse()
' Dim sr As System.IO.StreamReader = New StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("UTF-8"))
Bity = WebClient1.DownloadData(TextBoxProfileLink.Text)
content = System.Text.Encoding.UTF8.GetString(Bity)

وب کانفیگ


<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<httpRuntime maxRequestLength="1000000" executionTimeout="35000"/>
<customErrors mode="Off"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" batchTimeout="35000"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" asyncTimeout="3333333">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Generic"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
</system.web>
</configuration>