UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • Image
  • 3342
  • AutoPostBa
  • highlight
  • Sourcetree
  • 0,
  • 1833
  • C
  • array
  • 低安全性
  • write ORDE
  • 20
  • 116 DNS
  • 784
  • 日期
  • �
  • WU
  • ti
  • sw
  • Print
  • ARR
  • 66 order b
  • 黑貓 EGS
  • 308
  • web
  • 204
  • 0
  • [t]
  • 網址
  • [u2]
  • 56
  • 108
  • s3
  • batch
  • asp.ne
  • .
  • query
  • 黑貓
  • 0KeeTeam
  • MD5
  • 403 - Forb
  • doug
  • ses
  • EN
  • 光寶
  • sing
  • Exception
  • IIS
  • 80
  • a
頁數 50 / 55 上一頁 下一頁
搜尋 結果:
把 Hashtable 的 Keys 轉為 String Array
有點笨的問題, 但每次遇到都忘了要怎麼定義字串陣列 :P 在這裡記錄一下.. 以下的 HT 是一個 Hashtable
Dim arrKeys(HT.Count - 1) As String
HT.Keys.CopyTo(arrKeys, 0)
More...
Bike, 2012/6/6 下午 03:58:21
UW.LM 翻譯物件
hi:
我在 UW 4.0 附上之前做的翻譯物件,使用方法在附檔裡
基本上是把拆解網頁文字翻譯內容放在xml文字檔裡面
這是以一般ASP.NET開發方式用Server Control來處理
用 AutoTranlate 可以很快取代所有文字,不用一個一個取代
但是遇到我們Template物件,就不能用啦
這部分我再調一下,讓 Template物件也能夠 AutoTranlate
More...
darren, 2012/6/5 下午 07:53:16
CKEditor 的 insertHTML 和 setData
在 CKEditor 中, 使用 insertHtml可以保留游標的位置, 所以在插入文字時, 大多使用 insertHtml, 但在CKEditor 的內容為空白時, insertHtml好像會失效. 這時就要用 setData 了.

if(CKEDITOR.instances['<% = me.txtContent.ClientId %>'].getData() == ''){
    CKEDITOR.instances['<% = me.txtContent.ClientId %>'].setData('<img src="' + oRes.msg + '" alt="" />');
}
else{
    CKEDITOR.instances['<% = me.txtContent.ClientId %>'].insertHtml('<img src="' + oRes.msg + '" alt="" />');
}
More...
Bike, 2012/6/4 下午 09:28:58
CKEditor 中貼上剪貼簿(clipboard) 中的圖片
在 Chrome 中, 可以直接把圖片用 ajax 傳到 Server 上. 請參考 在 Chrome 中, 直接把剪貼簿中的圖片用貼上的方式上傳到 Server 但若是要在 CKEditor 中貼上圖片, 會遇到一些問題, 主要的原因是 Past Event 綁定的方法不太一樣: 其中 ".<% = me.txtContent.ClientId %>"  要換成 textarea 的 id

$(document).ready(function () {
CKEDITOR.replace('<% = me.txtContent.ClientId %>', {
on: {
instanceReady: function (ev) {
this.dataProcessor.writer.setRules('p', {
indent: false, //縮排
breakBeforeOpen: true, // <P>之前是否換行
breakAfterOpen: true, // <P>之後是否換行
breakBeforeClose: false, // </P>之前是否換行
breakAfterClose: true // </P>之後是否換行
});
}
},
toolbar: 'basic'
});
});

$(document).ready(function () {
if (parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1]) >= 12) {
function bindPasteInCK() {
$("iframe").contents().find("body").bind('paste', imagePasteOnPaste);
}

CKEDITOR.instances.<% = me.txtContent.ClientId %>.on("instanceReady", bindPasteInCK);
}
});


參考資料: http://fogbugz.stackexchange.com/questions/8744/bugmonkey-paste-image-into-case-what-does-wiki-do-with-images
More...
Bike, 2012/6/4 下午 06:01:15
HTML5 Canvas塗鴉板
在研究 Canvas 時, 發現的一個有趣應用, http://www.darkthread.net/miniajaxlab/html5canvas/canvas1a.htm
More...
Bike, 2012/6/3 上午 02:46:23
在 Chrome 中, 直接把剪貼簿(Clipboard)中的圖片用貼上的方式上傳到 Server
Client Side 的 HTML 如下: (若要在 CKEditor 中使用, 請參考: CKEditor 中貼上剪貼簿(clipboard) 中的圖片)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="/Scripts/jquery-1.7.1.min.js"></script>

<script type="text/javascript">
$(document).ready(function () {
$(window).bind("paste", function () {
if (event.clipboardData) {
var clipboardData, found;
found = false;
clipboardData = event.clipboardData;

Array.prototype.forEach.call(clipboardData.items, function (item, i) {
if (item.type.indexOf("image") !== -1) {
var blob = clipboardData.items[i].getAsFile();
var URL = window.URL || window.webkitURL;
var source = URL.createObjectURL(blob);

pastedImage = new Image();
pastedImage.src = source;
pastedImage.onload = function () {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");

canvas.width = pastedImage.width;
canvas.height = pastedImage.height;
ctx.drawImage(pastedImage, 0, 0);

var base64 = canvas.toDataURL();
base64 = base64.substring(base64.indexOf("iVBOR"));

$.ajax({
url: "/API/AddTaskImages.aspx",
async: false,
type: "POST",
data: ({
Image: base64
}),
dataType: "html",
success: function (msg) {
var oRes;
try {
oRes = eval(msg);
}
catch (err) {
alert("無法解析傳回資料 !");
alert(msg);
alert(err);
}
if (oRes.success) {
alert("Upload Success..");
//alert(oRes.msg);
$("#MyImageDataLoadDemo").attr("src", oRes.msg);
} else {
alert(oRes.msg);
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
})
};

return false;
}
});
}
});
});
</script>
</head>
<body>



<div id="hold">
<div id="imgHold"><img src="" id="MyImageDataLoadDemo"></div>
<div>Click on the area above and ctrl+p an image to paste</div>
</div>
</body>
</html>



Server Side 的程式碼如下:

Partial Class API_AddTaskImages
Inherits System.Web.UI.Page

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
'DB.sysconfig.Path.TaskAttachment

Dim Base64 As String = Me.Request("Image")
'UW.JSON.WriteErrorMessage(Base64)

'Return


Dim imageBytes As Byte() = Convert.FromBase64String(Me.Request("Image"))

Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream(imageBytes, 0, imageBytes.Length)

ms.Write(imageBytes, 0, imageBytes.Length)
Dim image As System.Drawing.Image = System.Drawing.Image.FromStream(ms, True)

Dim map As Bitmap


Dim Filename As String = Now.ToString("yyyyMMddHHmmssfff") & ".png"

Try
System.IO.Directory.CreateDirectory(DB.sysconfig.Path.TaskAttachment & "UploadImages")
image.Save(DB.sysconfig.Path.TaskAttachment & "UploadImages\" & Filename, System.Drawing.Imaging.ImageFormat.Png)

UW.JSON.WriteSuccessMessage(DB.sysconfig.URL.TaskAttachment & "UploadImages/" & Filename)
Catch ex As Exception
UW.JSON.WriteErrorMessage(ex.ToString)
End Try

End Sub
End Class
More...
Bike, 2012/6/3 上午 02:33:36
Windows 2008 SMB2.0 切換 SMB1.0 (與共享目錄效能有關)
狀況

手札的圖片共享目錄約三~四天會無法開啟(\\192.168.0.7 直接掛掉)
對應的服務 Server 會無法重新開啟

在 Windows 2008 Server 將 SMB2.0 => SMB 1.0 方法
參考連結 http://www.petri.co.il/how-to-disable-smb-2-on-windows-vista-or-server-2008.htm

Client  關閉
sc config lanmanworkstation depend= bowser/mrxsmb10/nsi
sc config mrxsmb20 start= disabled

Client 重開
sc config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi
sc config mrxsmb20 start= auto

Server
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\Smb2 => 設為 Dword 0
需重開機,開機完後 Client 連不到也需重開

設好後,這些背後靈又出現要設了。
HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\MaxCmds => 500 以上
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\MaxMpxCt =>500 以上
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\MaxWorkItems => 5000以上

設完後有以下現象。
系統管理工具=>共用與存放管理=>管理工作階段  
每個連線的開啟檔案數是會增加減少跳動的,在SMB2.0下僅會緩慢增加
 




More...
Jerry, 2012/6/2 下午 03:57:43
Firefox 抓滑鼠在HTML Element上的位置
Firefox 沒有 offsetX 和 offsetY,解決方法是從父層把left 和top做累加。
    function getOffset(e) {
        /*e: Mousemove Event*/
        if (e.target.offsetLeft == undefined) {
            /*firefox only*/
            e.target = target.parentNode;
        }
        var tarPos = getTarPos(e.target);
        var tarMousePos = { x: window.pageXOffset + e.clientX, y: window.pageYOffset + e.clientY     };
        var offset = { offsetX: tarMousePos.x - tarPos.x, offsetY: tarMousePos.y - tarPos.y };
        return offset;
    }
    function getTarPos(el) {
        var page = { x: 0, y: 0 };
        while (el) {
            page.x += el.offsetLeft;
            page.y += el.offsetTop;
            el = el.offsetParent;
        }
        return page;
    }
More...
瞇瞇, 2012/5/31 下午 12:59:46
C# memo
*****2012/08/03************************************************
vb: a mod b
c#: a % b

*****2012/06/27************************************************
Server.UrlEncode("xxxx") => HttpUtility.UrlEncode("xxxxx");
Response.Write("XXX") =>  HttpContext.Current.Response.Write("XXX");
******************************************************************

型別轉換(int)XXXXXX,將XXXXX轉換為型別int

轉換Value 至 Enum
oRec.Status = (DB.ForumArticle.EN.Status)Enum.Parse(typeof(DB.ForumArticle.EN.Status), this.ddlENStatus.SelectedValue);

強制轉換型別至int
int Status = (int)DB.ForumArticle.EN.Status.Deleted;

vb
Public Shared Funciont AA() as string
 return xxxxx
End Function


C#
public static string aa()
{
 return xxxx
}



vb
Public Shared Sub AA()
......
End Sub


C#
public static void AA()
{
.....
}



vb
Try
 xxxxxx
Catch ex As Exception
 UW.WU.WriteErrorToLog(ex)
End Try


C#
try
{
 xxxxxx
}
catch (Exception ex)
{
 tran.Rollback();
}



Split
char[] delimiterChars = { ',' };
foreach (string tags in cbTags.Split(delimiterChars))
{

}



vb
select case AA
 case "AA"
  xxx
 case "BB"
  bbb
 case else
  aaaa
end select


C#
switch (AA) {
 case "AA":
  xxx();
  break;
 case "BB":
  bbb();
  break;
 default:
  aaaa();
  break;
}
More...
Reiko, 2012/5/31 上午 11:55:50
inline 物件的 margin-top 會被略過
<a href='#' style="background-color:#cccccc; color=black; padding: 3px; margin:6px 6px 6px 6px;">AA</a>
<a href='#' style="background-color:#cccccc; color=black; padding: 3px; margin:6px 6px 6px 6px;">BB</a>
--> 其中因為 a 是 inline 物件, margin 的 Top 會被略過


若是想要保持兩個 Link在同一行, 又要有上方的 margin, 可以在外面再包一個 div
<div style="margin-top:6px;">
<a href='#' style="background-color:#cccccc; color=black; padding: 3px; margin:6px 6px 6px 6px;">AA</a>
<a href='#' style="background-color:#cccccc; color=black; padding: 3px; margin:6px 6px 6px 6px;">BB</a>
</div>
More...
Bike, 2012/5/20 上午 09:18:10
|< …41424344454647484950… >|
頁數 50 / 55 上一頁 下一頁
~ Uwinfo ~