C# winform上传,删除服务器文件
摘要:今天在winform上需要上传,删除服务器上的文件,网上找了下上传是很多,可删除没有找到答案,,最后只能拿个土办法实现了,这里是用ashx文件来处理上传:B/Spublic void ProcessRequest(HttpContext context) { foreach (string fileKey in context.Request.Files) { try { HttpPostedFile file = context.Request.Files[fileKey]; string oldFileName = file.FileName; //原文件名 xxx.jpg int ex.
阅读全文
Extjs显示从数据库取出时间并JSON化后的问题
摘要:后台从数据库取出时间,JSON格式化后再传到gridpanel,这时时间变成了:/Date(32331121223)/这样的格式,那么这时需要以下处理才可以正常显示:在var record = Ext.data.Record.create([ { name: 'PublicDate', mapping: 'PublicDate', dateFormat: 'Y-m-d', convert: function (v) { if (v == null) { return null; } var d = new Date(); var str = v.
阅读全文
js随写
摘要:比如一个方法:slideUp(参数,回调函数);由于头脑比较痴呆,所以都搞不明白是怎么写的;今天偶尔看到了,让我明白了。恍然,还挺简单的;例如:window.onload = function(){ test({top:"11px", left:"12px", bottom:"13px"}, function(){ alert("已经执行完成");})}//定义function test(json, callback){ for(j in json){ alert(json[j]); } if(callback){
阅读全文
js with用法
摘要:看以with用法,感觉很实用,就蛮写了下;with:为一个或一组 属性或方法 指定默认对象形式:with(对象){ 单写属性或方法}例:var test = function(){ this.str1 = "width test1"; this.str2 = "width test2";//这里需使用this};test.prototype.method = function(){ alert("method");}window.onload = function(){ var t = new test(); alert(t.str1
阅读全文