收到错误电话报告通用通信错误 [英] getting error phone reports the generic communcation error

查看:51
本文介绍了收到错误电话报告通用通信错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这部分代码出现错误.

我在C#中制作一个发送和接收消息的应用程序.该应用程序可以很好地发送但可以接收.
我在这部分代码上出错..

手机会报告通用通讯错误或语法错误.

消息发送工作正常..仅在接收到我遇到该错误时..该代码的prt中出现异常.

i am getting error on this part of code.

i am making a sending and reciveing mesages application in C# . the application works fine for sending but for recieving.
i am getting error on this part of code..

phone reports the generic communcation error or sytax error.

message sending works fine.. only in receiving i am getting that error .. exception comes in that prt of the code.

try
			{
				// Read all SMS messages from the storage
								
				DecodedShortMessage[] messages = CommSetting.comm.ReadMessages(PhoneMessageStatus.All, storage);
				foreach(DecodedShortMessage message in messages)
				{
					Output(string.Format("Message status = {0}, Location = {1}/{2}",
						StatusToString(message.Status),	message.Storage, message.Index));
					ShowMessage(message.Data);
					Output("");				
				}
				Output(string.Format("{0,9} messages read.", messages.Length.ToString()));
				Output("");				
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}

			Cursor.Current = Cursors.Default;		
		}

推荐答案

代码似乎来自本文 ^ ].
您是否尝试过编译并运行本文随附的代码以查看其是否确实收到了SMS.如果该代码有效,则需要仔细阅读一下,看看区别在哪里.
The code seems to come from this article How To Send and Receive SMS using GSM Modem[^].
Have you tried compiling and running the code that comes with the article to see if it does receive the SMS. If the code works you will need to go through yours and see where the differences are.


这篇关于收到错误电话报告通用通信错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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