首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >此标签未被引用停止发布的警告消息

此标签未被引用停止发布的警告消息
EN

Stack Overflow用户
提问于 2019-04-23 14:49:34
回答 1查看 838关注 0票数 0

我已经为一些特定的响应创建了一些web api。编译良好,并在visual studio localhost上运行。无论我如何发布它,它都会给我一个错误,比如:

代码语言:javascript
复制
 Warning    15  This label has not been referenced  C:\MSSMS.infisms.co.in\MSSMS.infisms.co.in\App_Code\BulkSMS.cs  578 5   C:\MSSMS.infisms.co.in\MSSMS.infisms.co.in\

这是我的服务代码:

代码语言:javascript
复制
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class BulkSMS : System.Web.Services.WebService
{
    public BulkSMS()
    {
        //Uncomment the following line if using designed components 
        //InitializeComponent();         
    }

    #region Sendmessage

    public string SendQuickMessage(string C_Name, string MobileNo, string Message, int AccountType, int Sender, int MessageType)
    {
        string Response = " ";// string.Empty;
        try
        {
            int CharCount = CharMsgCount(Message, MessageType);
            string[] Mobilenos = MobileNo.Split(',');

            foreach (string Mobile in Mobilenos)
            {
                AppGlobal.Message message = new AppGlobal.Message();
                message.intUserID = SiteUser.Current().UserID;
                message.strC_Name = C_Name;
                message.strMobileNo = Mobile;
                message.strMessageText = Message;
                message.intAccounttype = AccountType;
                message.intSenderID = Sender;
                message.intMessagetype = MessageType;
                message.dtReceiveTime = DateTime.Now;
                message.intCharCount = CharCount;

                AppGlobal.Messagequeuq.Enqueue(message);

                //Mysql.ExecuteNonQuery("BulkSMS_SendQuickMessage", SiteUser.Current().UserID, C_Name, Mobile, Message, AccountType, Sender, MessageType);
            }
            //Mysql.ExecuteNonQuery("BulkSMS_AddArchiveMessgae", SiteUser.Current().UserID, Message);

            Response = "Success";
        }
        catch (Exception ex)
        {
            Response = "Error in BulkSMS_SendQuickMessage : " + MobileNo + "  " + CommonMethods.GetErrorMessage(ex, "BulkSMS_AddArchiveMessgae");
        }
    **RESPONSE:// this line gives warning message not referenced label**
        if (!string.IsNullOrWhiteSpace(Response))
            AppGlobal.Logger.WriteToErrorLogFile(Response);
        return Response;
    }

帮帮我吧伙计们..。

EN

回答 1

Stack Overflow用户

发布于 2019-09-13 16:51:50

原因是“标签没有被引用”。您必须在goto语句中使用创建的标签,如下所示

代码语言:javascript
复制
Response: // you have created a label with name "Response".
{
   //your for loop is executed inside your label block.
}
goto Response;

添加goto Response语句将禁用该警告。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55805734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档