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
標籤
  • date[t],
  • -5103 UNIO
  • Image
  • .
  • 20
  • 使用者
  • 網址
  • -8908
  • C
  • ? ORDER BY
  • git
  • SQL
  • asp
  • hhhh
  • 868
  • 8330
  • web
  • sing
  • 476
  • UNT
  • 2446
  • C#
  • free
  • max
  • Scaffold
  • gpo
  • IP
  • structure
  • aspx
  • ajax ORDER
  • CKED
  • Vue
  • win
  • Data
  • aGoELisk
  • image,
  • ClientIP
  • image[t]
  • [t],
  • ef
  • ie
  • a
  • https
  • visual
  • lucene.net
  • dddd
  • 674
  • ad
  • 要求長度
  • jq
頁數 8 / 31 上一頁 下一頁
搜尋 ad 結果:
奇怪的 alert 問題.. 用 setTimeout 來解決.
以下的程式碼, 直接 alert(this.errorMessages); 會造成 chrome 卡住..
使用  setTimeout 延後 alert 可以解決這個問題. 但必需延後足夠的時間. 已知 200 ms 依然會卡住.

    errorMessages: "",

    failProcess: function (ret) {
        console.log("failProcess start: " + new Date().getSeconds() + "." + new Date().getMilliseconds());
        var json = ret.responseJSON;
        if (json && json.invalidatedPayloads) {
            var errors = json.invalidatedPayloads.filter(function F(x) {
                return x.messages.length > 0
            });

            console.log("bdfore add class: " + new Date().getSeconds() + "." + new Date().getMilliseconds());

            errors.map(function (x) {
                return $("[name='" + x.name + "']").addClass("error");
            });

            console.log("after add class: " + new Date().getSeconds() + "." + new Date().getMilliseconds());

            errorMessages = errors.map(function (x) {
                    return x.messages.join('\r\n');
            }).join('\r\n');

            console.log("afger build errorMessages: " + new Date().getSeconds() + "." + new Date().getMilliseconds());
            console.log(errorMessages);

            //alert(this.errorMessages);

            window.setTimeout(api.alertError, 500);

            console.log("after alert: " + new Date().getSeconds() + "." + new Date().getMilliseconds());
        }

        console.log("failProcess end: " + new Date().getSeconds() + "." + new Date().getMilliseconds());
    },
More...
Bike, 2021/9/29 下午 08:45:07
Framework未安裝, 但實際上已經安裝

下載Runtime版本打開後出現, 【這部電腦已經安裝 .NET Framework 4.6.2 (含) 以上版本的更新】

後來下載Developer Pack版本安裝完畢後就可以了
https://dotnet.microsoft.com/download/dotnet-framework/net462​​​​​​​

 
More...
choco, 2021/8/23 下午 02:28:48
.Net Framework 的 Web API, AuthorizeAttribute 失效.
config.MapHttpAttributeRoutes(); 不可以放在 Startup 的 Configuration 裡面.

必需放在 WebApiConfig 的 Register 之中,  並在 Application_Start 之中執行 GlobalConfiguration.Configure(WebApiConfig.Register) 

 
 
 
 
 
More...
Bike, 2021/8/22 下午 10:15:13
在 Hyper-V 上面安裝 windows server 2019, 但無法由 iso 開機
Disable secure boot in the VM menu, that'll fix it.



from: 
https://community.spiceworks.com/topic/1719453-hyper-v-gen-2-vm-unable-to-boot-from-iso-file-to-install-os
More...
Bike, 2021/8/5 下午 09:10:51
Swagger 的問題解決 (NSwag)
在 .Net Core 的專案使用 NSwag 時遇到: Unable to render this definition, The provided definition does not specify a valid version field. 錯誤. 有點一頭霧水, 最後解決了, 大概記錄一下解決的過程:




1. 把所有的 Controller 全部移. 再開啟 /swager, 此時應該會有空的 swager 頁面, 若異常, 則應該是 NSwag 沒裝好.

2. 把 Controller 一個一個加入專案, 每加入一個, 就開啟一次 /swager 的頁面, 若是發現異常, 就是那個 controller 有問題.

3. 找到有問題的 Controller 之後, 可以把內容先全部註解掉, 然後再一個一個的把 function 加回 controller, 應該就可以找到造成問題的 Action. 該問題有可能是以下情況造成:
    A. Action 沒有指定存取的 method.
    B. 不是 Action 的 function 被設定為 public (在 Controller 裡面, 非提供 client 端存取的 function, 都不應被設為 public)
    C. 這個很神奇, 註解也有可能造成問題, 試著把該 Action 的註解刪除, 再重新加入, 說不定就會好了.



 
另外, 使用 swagger 時, 要記得在專案的屬性的建置選項中, 要勾選 XML 註解輸出, 才會自動把  Action 的註解變成說明文字.:

 
 
More...
Bike, 2021/8/2 上午 05:00:21
UW DB 元件罕見的錯誤
今天小三的網站發生怪異的情況,造成網站莫名其妙跑出天天簽到的彈跳視窗


var oEM = new EverydayMain();
oEM.EndDate__StartOrEqual = DateTime.Now.Date; //只要限結束日期就好. (以日為單位)
oEM.Type = EN.Type.彈出式;

oEM.QuerySql();
// 卻產出SQL Select * from [Everyday_Main] With(NoLock)
// 但應該產出 Select * from [Everyday_Main] With(NoLock)    Where [EndDate] >= Convert(datetime, '2021-07-15T00:00:00') and [EN_Type] = 200


使用 set 條件,但產出的SQL卻是沒有 where 字串,這情況我是第一次遇到
是不是產出SQL時這中間用到 static 物件,可能要查一下
-----------------------------
        private static Hashtable _htTypeDefines;
        public static Hashtable htTypeDefines
        {
            get
            {
                if (_htTypeDefines == null)
                {
                    _htTypeDefines = new Hashtable();
                    _htTypeDefines.Add("Id", "int");


看樣子是網站第一次使用DB物件時,兩個 thread 同時在跑會造成這樣的現象
這裡應該要 lock 
 
More...
darren, 2021/7/15 下午 12:32:38
HTTP 錯誤 413.1 - Request Entity Too Large
 


httpRuntime 加 maxRequestLength 沒作用, 請到 system.webServer 設定 maxAllowedContentLength
<system.webServer>
...
<security>
<requestFiltering>
    <!--1073741824 ==> 1GB-->
    <requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
...
</system.webServer>

 
More...
Reiko, 2021/3/25 下午 02:36:36
用 source tree 把 branch 合併到 master 之後再建立新的 branch
1. 先切換到 master (最好是 pull 一次, 以確定是最新版本)

2. 在左側選單選點選要切換的 branch, 按右鍵. 選 Merge xxxx into current branch
 

3. 點選 master merge 前一個節點. 按右鍵, 選 Reset current branch to this branch.


4. 再來就可以比照舊的方法建立新 branch 了.


 
More...
Bike, 2021/3/13 下午 03:32:12
衝碼問題 許功蓋 Big5 ASCII
衝碼問題[編輯]
因為低位元字元中包含了程式語言、shell、script中,字串或命令常會用到的特殊字元,例如0x5C「\」、0x7C「|」等。「\」在許多用途的字串中是當作轉義符號,例如\n(換行)、\r(歸位)、\t(tab)、\\(\本身符號)、\"(引號)等等。而「|」在UNIX作業系統中大多當作命令管線的使用,如"ls -la | more"等等。如果在字串中有這些特殊的轉義字元,會被程式或直譯器解釋為特殊用途。但是因為是中文的原因,故無法正確解釋為上面所述的行為,因此程式可能會忽略此轉義符號或是誤當作轉義符號而中斷執行。若此,就違反了使用者本來要當成中文字元一部份使用的本意。[11]
低位元字元與ASCII重疊的字元如下︰
@ A-Z [ \ ] ^ _ ` a-z { | } ~
在常用字如「功」(0xA55C)、「許」(0xB35C)、「蓋」(0xBB5C)、「育」(0xA87C)中時常出現,造成了許多軟體無法正確處理以Big5編碼的字串或檔案。這個問題被戲謔性地人名化,稱為「許功蓋」或「許蓋功」(這三個字都有這種問題)。
一般的解決方法,是額外增加「\」的字元,因為「\\」會被解釋為「\」,所以「成功\因素」這個字串就能無誤地被程式當作「成功因素」的字串來處理。但是額外的困擾是,有些輸出功能並不會把「\」當作特殊字元看待,所以有些程式或網頁就會錯誤地常常出現在「許功蓋」這些字後面多了「\」。[11]

參考資料
zh.wikipedia.org/wiki/大五碼
More...
sean, 2020/12/30 下午 03:00:46
ORM 的新範列
一些範列如下:

        //直接使用 Operator
        var products = ORM.Product.Select()
            .Where(CN.Product.Name == "ABC")
            .And(CN.Product.Name != "DEF")
            .And(CN.Product.Name % "ABC%") //這是 Like
            .And(CN.Product.Name | "apple, orange".SqlListStr()) // 這是 in
            .And(CN.Product.Is_Available)
            .And(!CN.Product.Is_Deleted)
            .And(CN.Product.OriginalPrice > 5)
            .And(CN.Product.OriginalPrice <= 500)
            .And(CN.Product.CreateDate < DateTime.Now.AddMonths(-1))
            .GetList<ORM.Product>();

//產出 SQL: Select * From [Product] (NoLock) Where ( ([Name] <> N'DEF') ) And ( ([Name] like N'ABC%') ) And ( ([Name] in ('apple',' orange')) ) And ([Is_Available] = 'Y') And ( ([Is_Deleted] = 'N') ) And ( ([OriginalPrice] > 5) ) And ( ([OriginalPrice] <= 500) ) And ( ([CreateDate] < '2020-11-26T10:17:15.553') )


        //用 Id 取出物件並修改
        var product = ORM.Product.Get(3);
        U2.WU.DebugWriteLine(product.Name);
        product.Name = "平格藍均抱枕套45*45 ABC";
        product.Modify();

        //新增一筆資料
        var newId = new ORM.Product()
        {
            Name = "New Product",
            OriginalPrice = 100,
            Is_Hot = "Y"
        }.Add();

        //用 Id 修改資料
        var updateCount = new ORM.Product(3)
        {
            Name = "New Product",
            OriginalPrice = 100,
            Is_Hot = "Y"
        }.Modify();

More...
Bike, 2020/12/26 下午 12:04:26
|< 12345678910… >|
頁數 8 / 31 上一頁 下一頁
~ Uwinfo ~