我正在尝试在数据库中的某些值超过其阈值时发送邮件c#.
我已经在Windows防火墙中允许端口25,587和465.并禁用防病毒软件中防止群发邮件的选项.我正在使用的代码如下
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
MailMessage mailMsg = new MailMessage();
mailMsg.To.Add("to@domain.com");
// From
MailAddress mailAddress = new MailAddress("from@domain.com");
mailMsg.From = mailAddress;
// Subject and Body
mailMsg.Subject = "MCAS Alert";
mailMsg.Body = "Parameter out of range";
SmtpClient smtpClient = new SmtpClient("smtp.servername.com", 25);
smtpClient.UseDefaultCredentials = false;
smtpClient.Timeout = 30000;
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("username", "passwrod");
smtpClient.Credentials = credentials;
smtpClient.EnableSsl = true;
//ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
smtpClient.Send(mailMsg);
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪 …
如何使用JSON数据绘制highchart Gauge?
我正在研究高图规格,我在显示数据库的最新数据方面取得了成功.我用JavaScriptSerializer它了
代码是......
<script type="text/javascript">
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
//Other char parameter comes here
}
function (chart) {
setInterval(function () {
$.getJSON("S14.aspx", function (data, textStatus) {
console.log(data);
$.each(data, function (index, wind) {
var point = chart.series[0].points[0],
newVal = wind;
point.update(newVal);
});
});
}, 3000);
});
Run Code Online (Sandbox Code Playgroud)
JSON的代码是
public string chartData1
{
get;
set;
}
protected void Page_Load(object sender, EventArgs …Run Code Online (Sandbox Code Playgroud) SQL Server 2012是否可以像使用HTTP 那样访问数据库对象SQL Server 2000?
我提到了下面的文章,但它是关于SQL Server 2000.
我想通过以下方式访问数据库对象
http://iisserver(my machine ip)/nwind/dbobject/Test4[@Id='1']/@x
Run Code Online (Sandbox Code Playgroud) 我正在使用高图,只有当我在Intranet网络中的IIS服务器上运行我的网站时才会收到此错误.相反,它在开发服务器中工作正常(visual studio 2012)
图表处理程序配置[c:\ TempImageFiles]中的临时图像目录无效.请编辑web.config文件.CharImageHandler键,Dir值必须指向有效目录.当存储模式等于文件系统时,该目录是临时映像存储所必需的.
堆栈跟踪
[DirectoryNotFoundException: Invalid temp images directory in chart handler configuration [c:\TempImageFiles\]. Please edit the web.config file. The CharImageHandler key, Dir value must point to a valid directory. The directory is required for temporary image storage when storage mode equals file system.]
System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.Inspect() +1426397
System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ParseParams(String parameters) +1352
System.Web.UI.DataVisualization.Charting.ChartHttpHandler.get_Settings() +197
System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeControllerFile() +51
System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean hardCheck) +357
System.Web.UI.DataVisualization.Charting.Chart.get_CurrentImageLocation() +50
System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter writer) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, …Run Code Online (Sandbox Code Playgroud) 有没有办法在asp.net或使用javascript,当有人点击日历上显示的周数,我可以在标签上获取日期(星期一到星期五)?
在配置时SQL Server 2012 Master Data Services,我遇到了以下问题
.svc handler未安装所需的映射IIS.
我想要做的是,我想使用URL查询我的数据库,以便我可以使用自己的URL直接检索数据,就像我们可以将查询字符串参数存储到SQL Server中一样
我如何处理它,我遵循了几个文件,但没有任何想法.
我DataTable从SQL Server 创建了一个.代码如下
protected void BindGridviewData()
{
StringBuilder str = new StringBuilder();
SqlConnection con = new SqlConnection("Data Source=INBDQ2WK2LBCD2S\\SQLEXPRESS;Initial Catalog=MCAS;Integrated Security=SSPI");
SqlDataAdapter adp = new SqlDataAdapter("select top 10 * from test4 order by Id desc", con);
DataTable dt = new DataTable();
adp.Fill(dt);
}
Run Code Online (Sandbox Code Playgroud)
现在我如何JSON从数据表创建文件
好吧,我从来没有尝试过for循环.我想将for循环增加8而不是一般的后增量.我正在尝试这样的事情.
for(U8 i=3;i<=31;i+8,j++){
Array[j]=(Status>>i) ;
if (j>3){
j = 0;
}
}
Run Code Online (Sandbox Code Playgroud)
好吧它给了我警告,就像逗号表达式的左手操作数没有效果.这个警告是什么意思?我的逻辑会起作用吗?status包含我系统的32位信息,我需要特殊的位.
asp.net ×4
c# ×3
sql-server ×3
highcharts ×2
iis ×2
c++ ×1
calendar ×1
email ×1
for-loop ×1
http ×1
javascript ×1
json ×1
smtp ×1
sockets ×1