NewLine字符,用于在C#.net的代码后面发送短信

本文关键字:代码 字符 用于 net NewLine | 更新日期: 2023-09-27 18:00:06

短信是一个字符串,我想把文本分成不同的行,但似乎没有换行符。

sdr.Read();

                        PrisonerStatus = sdr.GetString(0);
                        LastName = sdr.GetString(1);
                        MiddleName = sdr.GetString(2);
                        FirstName = sdr.GetString(3);
                        Gender = sdr.GetString(4);
                        DateOfBirth = sdr.GetString(5);
                        Genotype = sdr.GetString(6);
                        BloodGroup = sdr.GetString(7);
                        DateOfCommittal = sdr.GetString(8);
                        DateOfNaturalExpirationOfSentence = sdr.GetString(9);
                        ActualDateOfRelease = sdr.GetString(10);
                        CellInfo = sdr.GetString(11);
                        Color = sdr.GetString(12);
                        TribeOrCountryOfOrigin = sdr.GetString(13);

                        sdr.Close();
                        if (tokens[2] == "details")
                        {
                            //This is where i need the formating so sms receiver sees it as shown below
                            //PS. Using Ozeki Message server
                            message = "PrisonerID : " + prisonID + ''n' +
                                      "Full Name : " + LastName + " " + MiddleName + " " + FirstName + ''n' +
                                      "Gender : " + Gender;
                            SendToOutbox(message);
                        }
                        else
                        {
                            message = "Unknown transaction code";
                            output.UpdateDisplay("Error :" + message);
                            SendToOutbox(message);
                            goto Label_021C;
                        }

NewLine字符,用于在C#.net的代码后面发送短信

这应该有效,使用"而不是'

message = "PrisonerID : " + prisonID + "'n" +
          "Full Name : " + LastName + " " + MiddleName + " " + FirstName + "'n" +
          "Gender : " + Gender;

使用此代码:

注意:@"'0x0A"

message = "PrisonerID : " + prisonID + @"'0x0A" +
"Full Name : " + LastName + " " + MiddleName + " " + FirstName + @"'0x0A" +
"Gender : " + Gender;

我使用了<br>标记,使用C#和PHP发送短信,它对我很有效示例:

message = "PrisonerID : " + prisonID + "<br>" +
"Full Name : " + LastName + " " + MiddleName + " " + FirstName + "<br>" +
"Gender : " + Gender;