我正在用C#.Net制作一个SMTP邮件应用程序.它适用于Gmail设置,但我必须将其用于连接到VSNL.我得到一个例外:"发送邮件失败"
我的设置似乎很完美.问题是什么?为什么我得到例外?
MailMessage mailMsg = new MailMessage();
MailAddress mailAddress = new MailAddress("mail@vsnl.net");
mailMsg.To.Add(textboxsecondry.Text);
mailMsg.From = mailAddress;
// Subject and Body
mailMsg.Subject = "Testing mail..";
mailMsg.Body = "connection testing..";
SmtpClient smtpClient = new SmtpClient("smtp.vsnl.net", 25);
var credentials = new System.Net.NetworkCredential("mail@vsnl.net", "password");
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = credentials;
smtpClient.Send(mailMsg);
Run Code Online (Sandbox Code Playgroud)
我得到一个例外......
System.IO.IOException:无法从传输连接读取数据:net_io_connectionclosed.
在System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(字节[]缓冲液,的Int32偏移的Int32读,布尔的readLine)
在System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader呼叫者,布尔ONELINE)
在System.Net.Mail.SmtpReplyReaderFactory .ReadLine(SmtpReplyReader呼叫者)
在System.Net.Mail.SmtpConnection.GetConnection(字符串主机的Int32端口)在System.Net.Mail.SmtpTransport.GetConnection(字符串主机的Int32端口)
在System.Net.Mail.SmtpClient.GetConnection ()
System.Net.Mail.SmtpClient.Send(MailMessage消息)
我看到网上有很多关于这个问题的资源.我必须UIViewContoller为我的单元格加载不同的XIB()文件.我设计了我的单元格,我希望在我的单元格中加载该设计.
我写了这段代码,但我得到了一个例外.
-[UIView setTableViewStyle:]: unrecognized selector sent to instance 0x6040de0
2011-07-11 14:42:27.461 TableViewTest[2776:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setTableViewStyle:]: unrecognized selector sent to instance 0x6040de0'
Run Code Online (Sandbox Code Playgroud)
这是我的加载nib文件的代码
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
// Load the top-level objects from the custom cell XIB.
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"loadXibfile" owner:self options:nil];
// Grab a pointer to the first object (presumably the custom cell, as that's …Run Code Online (Sandbox Code Playgroud) 我有一个主项目和另一个项目作为子项目添加.我想访问子项目中定义的头文件到主项目中,但不幸的是它说文件找不到错误.
请查看附加图像.我应该修改什么才能访问子项目的头文件?

如何计算c#.net中oledbconnection中的总行数
我想要计算我的表中有多少行.
string dataReader = "SELECT count(*) from `Email_account_list`";
OleDbCommand command_reader = new OleDbCommand(dataReader, myConnection);
OleDbDataReader row_reader = command_reader.ExecuteReader();
Run Code Online (Sandbox Code Playgroud)
我将写什么函数来获取表中存在的总行数.
我必须获取新闻源(公共墙)上的所有数据.我应该写什么查询?我写了"SELECT likes,message FROM stream WHERE source_id = %lld limit 50 "查询,但它正在返回我的墙值.我想获取我墙上和公共场所的所有数据(新闻Feed).
提前致谢
我的表中有很多记录.我想获取2条记录,这些记录应该具有最大或最后一个最大id值.我将如何在mysql中执行此操作?
我必须更新位置2和4处的数组值.如何更新数组值.我正在初始化我的数组,如下所示.
ArrayrData=[[NSArray alloc]initWithArray:statuses]; // where statuses is also an array
Run Code Online (Sandbox Code Playgroud) 我刚刚开始使用vc++ 2008。我只想看到一条消息(对话框)。我已将我的项目创建为 win32 项目应用程序。
我写了下面的代码来查看 MessageBox
MessageBoxW(NULL, "Window Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
Run Code Online (Sandbox Code Playgroud)
但我收到一个错误
错误 C2664:“MessageBoxW”:无法将参数 2 从“const char [28]”转换为“LPCWSTR”
这是什么错误?我需要做什么才能看到一个简单的消息框显示。
如何不显示导航控制器的Back Bar按钮.当我尝试用""编写我的标题时,这显示默认标题名称(Root).
怎么改呢?
我发现了一个编程问题来计算 3 个已知点之间的平均距离。
您已经给出了三个坐标点 (x1,y1)、(x2,y2) 和 (x3,y3),我必须计算这些点之间的平均距离。
如果有人知道公式,请告诉我我可以用编码编写。
我的方法:- 我可以从距离公式中得到每个坐标之间的距离,但我将如何计算平均距离,不知道。
distance1 = (x1,y1) 和 (x2,y2) 之间的点
distance2 = (x1,y1) 和 (x3,y3) 之间的点
distnace3 = (x2,y2) 和 (x3,y3) 之间的点
参考自
http://www.teacherschoice.com.au/maths_library/trigonometry/triangle_given_3_points.htm
iphone ×5
c# ×2
ado.net ×1
c ×1
c++ ×1
email ×1
facebook-fql ×1
ios ×1
logic ×1
mapkit ×1
math ×1
mysql ×1
nsarray ×1
nsstring ×1
objective-c ×1
oledb ×1
smtp ×1
uitableview ×1
visual-c++ ×1