This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static async void DownloadRemoteImageFile(string url, string fileName) | |
{ | |
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); | |
HttpWebResponse response; | |
try | |
{ | |
WebResponse webResponse = await webRequest.GetResponseAsync(); | |
response = webResponse as HttpWebResponse; | |
} | |
catch (Exception ex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 将jQuery对象数组中的每个元素的数值,限定为指定精度 | |
* 该方法假设文本框是<input type="number" /> ,利用数值文本框的一些特性辅助校验 | |
*/ | |
var formatNumber = function (arrJqueryObjects, precision) { | |
for (var idx = 0; idx < arrJqueryObjects.length; idx++) { | |
var $elem = arrJqueryObjects[idx]; | |
$elem.on("keyup", function () { | |
var numString = $(this).val().toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SqlWhereBuilder | |
{ | |
private readonly IList<string> whereList = new List<string>(); | |
private void AddInner(string name, object value, SearchType searchType) | |
{ | |
//if (value is string || value is DateTime) | |
// whereList.Add($"{name}='{value}'"); | |
//else | |
// whereList.Add($"{name}={value}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 截取数字并保留指定小数位 | |
/// </summary> | |
/// <param name="number">数字</param> | |
/// <param name="precision">要保留的小数位数</param> | |
/// <returns>截取后的数字</returns> | |
public static decimal TruncateNumber(decimal number, int precision) | |
{ | |
if (precision <= 0) return number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.isEmptyObject(someObject) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
.noborder, .noborder tr, .noborder th, .noborder td { | |
border: none; | |
} | |
</style> | |
<table class="noborder"> | |
<tr><th>Somethingr</th></tr> | |
<tr><td>Something</td></tr> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. System.Net.Mail.SmtpException: 发送邮件失败。 ---> System.IO.IOException: 无法从传输连接中读取数据: net_io_connectionclosed。 | |
(System.Net.Mail.SmtpException: Failure sending mail. Unable to read data from the transport connection) | |
2. System.Net.Mail.SmtpException: SMTP 服务器要求安全连接或客户端未通过身份验证。 服务器响应为:5.5.1 Authentication Required. | |
该异常是在使用 gmail 时抛出的。 | |
3. 异常信息:"5.5.2 helo command rejected need fully-qualified hostname" | |
错误代码:504 5.5.2 Helo command rejected: need fully-qualified hostname | |
错误原因:对方服务器的HELO信息不是完整的域名 | |
处理方式:请对方检查其HELO命令提供的域名信息,且保证其符合RFC1035国际标准的规定。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#div").tooltip({html: "111", isFocus : true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#username").on("keydown", function (e) { | |
if (e.keyCode == 13) { | |
// 回车提交表单 | |
$("fooForm").trigger("submit"); | |
} | |
}); |
OlderNewer