我附上我的洞程序错误报告,请纠正错误,帮助我。 [英] i attached my hole program with error report, pls rectify that error, help me.

查看:70
本文介绍了我附上我的洞程序错误报告,请纠正错误,帮助我。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.IO;

using System.Net;

using System.Text;

public partial class SMS : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        System.Net.WebClient webClient = new System.Net.WebClient();

string postData = "usr=yourapi username & pwd=yourapipwd&from= " + txtFrom.Text + "&to=" + txtTo.Text +"&type=text" + txtBody.Text;

webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");

lblResult.Text = webClient.UploadString("http://api.myvaluefirst.com/psms/servlet/psms.Eservice2?data=&lt;?xml%20version=\"1.0\"%20encoding=\"ISO-8859-1\"?><!DOCTYPE%20MESSAGE%20SYSTEM%20\"http://127.0.0.1/psms/dtd/message.dtd\"%20><MESSAGE><USER%20USERNAME=\"Your SMS API Username" + "\"%20PASSWORD=\"Your SMS API Password" + "\"/><SMS%20UDH=\"0\"%20CODING=\"1\"%20TEXT=\"" + txtBody.Text + "\"%20PROPERTY=\"0\"%20ID=\"1\"><ADDRESS%20FROM=\"919903013543\"%20TO=\"" + txtTo.Text + "\"%20SEQ=\"1\"%20TAG=\"some%20clientside%20random%20data\"%20/></SMS></MESSAGE>&action=send", postData);
    }

}













<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SMS.aspx.cs" Inherits="SMS" %>

<!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>
    <h1> Sending SMS Application </h1>
    </div>
    <p>

<asp:Label ID="lblTo" runat="server" Text="To:-"></asp:Label>

</p>

<asp:TextBox ID="txtTo" runat="server"></asp:TextBox>

<p>

<asp:Label ID="lblFrom" runat="server" Text="From:-"></asp:Label>

</p>

<asp:TextBox ID="txtFrom" runat="server" Width="128px"></asp:TextBox>

<p>

<asp:Label ID="lblBody" runat="server" Text="SMSMessage:-"></asp:Label>

</p>

<p>

<asp:TextBox ID="txtBody" TextMode="MultiLine" runat="server"></asp:TextBox>

</p>

<asp:Button ID="btnSend" runat="server" onclick="btnSend_Click" Text="Send"/>

<p>

<asp:Label ID="lblResult" runat="server" Text=""></asp:Label>

</p>
    </form>
</body>
</html>







输出:

编译错误



描述:编译服务此请求所需的资源时发生错误。请查看以下特定错误详细信息并相应地修改源代码。



编译器错误消息:CS1056:意外字符'\'



源错误:





第35行:webClient.Headers.Add(Content-Type,application / x-www-form-urlencoded);

第36行:

第37行:lblResult.Text = webClient.UploadString(http://api.myvaluefirst.com/psms/servlet/psms.Eservice2?data= ?< XML%20version = \ 1.0\ %20encoding = \ ISO-8859-1\ ><!DOCTYPE%20MESSAGE%20SYSTEM%20\的http:?!//127.0。 0.1 / psms / dtd / message.dtd\%20>< message>< user%20username> 38行:}

第39行:



源文件:d:\ Mohanraj \ Mohanraj \日常练习\ sms \SMS.aspx.cs行:37





显示详细的编译器输出:



显示完整的编译来源:





版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.1




Output:
Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1056: Unexpected character '\'

Source Error:


Line 35: webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");
Line 36:
Line 37: lblResult.Text = webClient.UploadString("http://api.myvaluefirst.com/psms/servlet/psms.Eservice2?data=<?xml%20version=\"1.0\"%20encoding=\"ISO-8859-1\"?><!DOCTYPE%20MESSAGE%20SYSTEM%20\"http://127.0.0.1/psms/dtd/message.dtd\"%20><message><user%20username>Line 38: }
Line 39:

Source File: d:\Mohanraj\Mohanraj\Daily practice\sms\SMS.aspx.cs Line: 37


Show Detailed Compiler Output:

Show Complete Compilation Source:


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

推荐答案

嗨试试这个



你需要修改附近的双qutos >


您的SMS API用户名







Content-Type,application / x-www-form-urlencoded







Hi Try this

You need to modify Double qutos near

"Your SMS API Username"

and

"Content-Type","application/x-www-form-urlencoded"



using System;

 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Web.UI.HtmlControls; 
using System.IO;
 
using System.Net;
 
using System.Text;
 
public partial class SMS : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        System.Net.WebClient webClient = new System.Net.WebClient();
 
string postData = "usr=yourapi username & pwd=yourapipwd&from= " + txtFrom.Text + "&to=" + txtTo.Text +"&type=text" + txtBody.Text;
 
webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");
 
lblResult.Text = webClient.UploadString("http://api.myvaluefirst.com/psms/servlet/psms.Eservice2?data=<?xml%20version=\"1.0\"%20encoding=\"ISO-8859-1\"?><user%20username>    }
 
}


这篇关于我附上我的洞程序错误报告,请纠正错误,帮助我。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆