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
標籤
  • C
  • mssql
  • 202
  • [t]
  • -1068
  • db
  • 存取被拒
  • 安裝
  • ICSharpCod
  • SU
  • background
  • SNMP
  • grpstkizsh
  • 782
  • cache
  • URL Rewrit
  • Language
  • setnumber
  • IIS
  • NPOI 弱點
  • CK
  • 字串
  • -3849
  • CS21211211
  • svn
  • shop
  • 移
  • json
  • jquery
  • Doug
  • list order
  • 100
  • 848
  • orm
  • en
  • chrome
  • aspjpeg
  • [u2]
  • Clipboard
  • Linq
  • LINE
  • InvalidOpe
  • 88
  • 860
  • 8
  • 766
  • 60
  • .net
  • 試
  • 隱碼
頁數 2 / 3 上一頁 下一頁
搜尋 prop 結果:
SU 的新規格 RFP
1. .Net Core 5.0 使用.
2. 可切換後, 適用於 MsSQL, MySql, Oracle
3. 預設所有 SQL 執行時要經過 SQL Injection 檢查.
(移除 "CheckDangerSQL", 併入 IsSqlInjection) 

預設會把 CR 和 LF 換成 空白,以免 sql injection 檢查發生錯誤, 有參數可以控制這個行為。sql 和 資料應該要分開,sql 中的 CR 和 LF 被換成空白應該不會有問題。

4. 不要再使用 SqlStr, 改用 SqlValue (避免誤用, SqlStr 有一個問題, 若是忘了加上 '' 會有可能造成 sql injection)

5. ORM 的 Class Name, 若遇到全大寫的字節, 要先轉小寫, 再把第一個字母變大寫.

6. CopyPropertiesTo, CopyTo.. 
   SetValue 時, 若發生錯誤, 要顯示錯誤欄位名稱. (Tmi 的版本, ObjUtil.cs)

7. CopyFromDataRow: 
   string 自動轉 DateTime
   string 自動轉  int, long, decimal..

8. Criteria 的 In 和 operator (|) 要接 list 做為參數, 不要再直接用字串做參數.

9. OrderBy 增加 by column 且可以多個串接

10. Update 時可以用 sql 語法 (參考聖宜的  GetSetFieldWithExpression)

11. 檢查 SQL Injection 的方法改為先把 \r 和 \n 用空白取代,再檢查, 再取代參數。

12. DtFromSql 和 ExecuteSql 傳入 connection 和 transaction 的版本先刪除,未來有需要再增加。 
More...
Bike, 2021/10/18 下午 04:29:15
DateTime porperty 的 Model Validation
對 DateTime 的 property 直接設定 Require 的 Validation 會失敗. 因為茌是 client 送來空白, 會發生轉型的錯誤, 而不是 Require 的錯誤

可以把該 property 改設定為 DateTime? 來解決這個問題.
More...
Bike, 2021/9/23 下午 10:26:41
SVN Commit 後可以修正 Message 之設定
因為希望大家 commit 程式都要寫一下訊息紀錄
但有人就是手快就 commit 了 ,事後要改卻跳出訊息告知不可以修改
查一下發現不是SVN設定檔加個勾勾就可以處理的,是要去 hooks 設定寫一段指令碼才可以
要去server端  去 Repository > 選 Properties > Hooks > 編輯 Pre-reversion property change hook

輸入以下指令
rem Only allow log messages to be changed.
if "%4" == "svn:log" exit 0
echo Property '%4' cannot be changed >&2
exit 1

  
 
 
 
 
More...
darren, 2020/3/20 下午 04:06:59
上傳圖片 直的變成橫的的問題
https://stackoverflow.com/questions/17186568/upload-from-ios-picture-to-net-app-rotate

 讀取某個參數來判斷            if (image_file.PropertyIdList.Contains(0x0112))
            {
                int rotationValue = image_file.GetPropertyItem(0x0112).Value[0];
                switch (rotationValue)
                {
                    case 1: // landscape, do nothing
                        break;

                    case 8: // rotated 90 right
                            // de-rotate:
                        image_file.RotateFlip(rotateFlipType: RotateFlipType.Rotate270FlipNone);
                        break;

                    case 3: // bottoms up
                        image_file.RotateFlip(rotateFlipType: RotateFlipType.Rotate180FlipNone);
                        break;

                    case 6: // rotated 90 left
                        image_file.RotateFlip(rotateFlipType: RotateFlipType.Rotate90FlipNone);

                        image_file.Save(Path + FileName);
                        break;
                }
            }
More...
sean, 2019/8/19 下午 06:11:28
[SQL] You do not have permission to use the bulk load statement
 
1. 從最外層找 Security(安全性) > 確認有bulkadmin

2. 從最外層找 Logins(登入) > 會使用 Bulk Inset 的帳號 
3. 右鍵點選Properties (屬性) > 點選 ServerRoles (伺服器角色)
4. 勾起 bulkadmin > Ok 即設定完成


 
More...
choco, 2018/10/8 下午 12:07:18
LINQ 用變數方式讀取欄位

        public void TEST(SEPM.SEPMDataContext oDC)
        {
            //一般 LINQ 寫法, 欄位只能寫死, 如:
            var Q = query.OrderBy(r => r.statusId).ToList();

            //若 OrderBy 的欄位不是固定的

            //方法一:條列
            var orderBy = "XXX";
            if (orderBy == "ownerId")
            {
                Q = Q.OrderBy(r => r.ownerId).ToList();
            }
            else if (orderBy == "endDate")
            {
                Q = Q.OrderBy(r => r.endDate).ToList();
            }

            //方法二:
            Q = Q.OrderBy(r => GetPropertyValue(r, orderBy)).ToList();
        }

        private object GetPropertyValue(object obj, string property)
        {
            System.Reflection.PropertyInfo propertyInfo = obj.GetType().GetProperty(property);
            return propertyInfo.GetValue(obj, null);
        }



參考:http://coderemind.blogspot.tw/2013/10/linq.html
More...
Reiko, 2018/4/20 上午 09:14:26
顯示錯誤位置的行數 MVC C# Error Line Number
https://stackoverflow.com/questions/628565/display-lines-number-in-stack-trace-for-net-assembly-in-release-mode/628590#628590

1. Go into the Properties window for the project where you want to see stack trace line numbers.
2. Click on the Build "vertical tab".
3. Select "Release" configuration. Check the DEBUG constant parameter.
4. Uncheck the "Optimize code" parameter to avoid the occasional trace issue with inlined code (this step is not essential).
5. Press the Advanced... button and choose Output -> Debug Info -> pdb-only.
6. Deploy the generated .pdb file with the assembly.

 
 
 
More...
Bike, 2018/4/9 上午 09:40:12
一些抓取資料庫結構及述敍用的 SQL
--抓所有的 Table
Select * from INFORMATION_SCHEMA.TABLES

--抓所有的 COLUMNS
Select * from INFORMATION_SCHEMA.COLUMNS


--抓欄位的 Description
select 
    st.name [Table],
    sc.name [Column],
    sep.value [Description]
from sys.tables st
inner join sys.columns sc on st.object_id = sc.object_id
left join sys.extended_properties sep on st.object_id = sep.major_id
                                        and sc.column_id = sep.minor_id
                                        and sep.name = 'MS_Description'
where st.name = 'TableName'
and sc.name = 'ColumnName'

--修改欄位的 Description.
EXEC sp_updateextendedproperty 
@name = N'MS_Description', @value = 'Your description',
@level0type = N'Schema', @level0name = 'dbo', 
@level1type = N'Table',  @level1name = 'TableName', 
@level2type = N'Column', @level2name = 'Name';


EXEC sp_addextendedproperty 
@name = N'MS_Description', @value = 'Code description',
@level0type = N'Schema', @level0name = 'dbo', 
@level1type = N'Table',  @level1name = 'TableName', 
@level2type = N'Column', @level2name = 'ColumnName';



--新增 Table 的 extendedproperty
EXEC sp_addextendedproperty 
@name = N'Description', @value = 'Hey, here is TableName description!',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table',  @level1name = 'TableName'
GO

--修改 Table 的 extendedproperty
EXEC sp_updateextendedproperty 
@name = N'Description', @value = 'Hey, here is my description! 123',
@level0type = N'Schema', @level0name = 'dbo',
@level1type = N'Table',  @level1name = 'TableName'
GO


--讀取 Extended Property
SELECT sys.objects.name AS TableName, ep.name AS PropertyName,
       ep.value AS Description
FROM sys.objects
CROSS APPLY fn_listextendedproperty(default,
                                    'SCHEMA', schema_name(schema_id),
                                    'TABLE', name, null, null) ep
WHERE sys.objects.name NOT IN ('sysdiagrams')
ORDER BY sys.objects.name

--讀取 Column 的 Description
SELECT objtype, objname, name, value  
FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', 'TableName', 'column', default);  
GO

--讀取特定 Table 的 Description
SELECT *  
FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', 'TableName', default, default);  
GO  

--讀取 所有 Table 的 Description
SELECT *  
FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', default, default, default);  
GO  


--新增或修改資料表說明
IF not exists(SELECT * FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', '資料表名稱', NULL, NULL))  
           BEGIN  
            exec sp_addextendedproperty 'MS_Description', '資料表說明', 'user', 'dbo', 'table', '資料表名稱' 
           END  
ELSE 
           BEGIN  
            exec sp_updateextendedproperty 'MS_Description', '資料表說明', 'user', 'dbo', 'table', '資料表名稱' 
           END

--新增或修改欄位說明
IF not exists(SELECT * FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', '資料表名稱', 'column', '欄位名稱')) 
           BEGIN  
            exec sp_addextendedproperty 'MS_Description', '欄位說明', 'user', 'dbo', 'table', '資料表名稱', 'column', '欄位名稱' 
           END  
ELSE 
           BEGIN  
            exec sp_updateextendedproperty 'MS_Description', '欄位說明', 'user', 'dbo', 'table', '資料表名稱', 'column', '欄位名稱' 
           END
More...
Bike, 2016/6/29 下午 04:42:25
jQuery 之 event.originalEvent
有時候用 jQuery 使用 event 物件時,會發現有些特殊事件的 property 抓不到 (undefined)
例如
mousewheel --> event.wheelDelta 
drop --> event.dataTransfer
touchstart --> event.touches[0].pageX
原因是 jQuery 的 event 只會包裝一般的屬性,特別的屬性要使用 event.originalEvent 去抓
event.originalEvent 是瀏覽器原生的 event

It's also important to note that the event object contains a property called originalEvent, which is the event object that the browser itself created. jQuery wraps this native event object with some useful methods and properties, but in some instances, you'll need to access the original event via event.originalEvent for instance. This is especially useful for touch events on mobile devices and tablets.

所以開發時當有些特殊屬性抓不到時,可以考慮用 event.originalEvent 去抓看看

    // 這是用滾輪放大縮小圖片 (此範例firefox不支援)
    $("#imgProductBig").bind("mousewheel", function (ev) {
        var delta = ev.originalEvent.wheelDelta > 0 ? 1 : -1;
        if (delta > 0 && zoomValue < 150) {
            zoomValue += 10;
        }
        else if (delta < 0 && zoomValue > 50) {
            zoomValue -= 10;
        }
        $(this).css("zoom", zoomValue + '%');
        return false;
    });


 
More...
darren, 2015/4/21 下午 12:03:35
防止 event 往上傳的終極方法
作global結帳時發生IE8不能選信用卡到期日,
因為 IE8 只吃 evt.cancelBubble = true 才不會把click事件往上層傳
所以以下是終極不會有問題的寫法

                if (evt.stopPropagation) { evt.stopPropagation() }
                if (evt.preventDefault) { evt.preventDefault() }
                try { evt.cancelBubble = true } catch (e) { }
                try { evt.returnValue = false } catch (e) { }


evt就是傳進來的event

(補充一下) 這個適合用 window.addEventListener 方式綁事件才需使用,如果用jQuery綁事件直接return false;就有一樣的效果


範例:

       // 經由bike提示,發現這範例不好 jQuery 可以直接 return false;
       $("#gc-exp-month-select a").click(function (evt) {
            $("#gc-exp-month").val($(this).text());
            $("#span-gc-exp-month").text($(this).text());
            $(this).parent().hide();
            if (evt.stopPropagation) { evt.stopPropagation() }
            if (evt.preventDefault) { evt.preventDefault() }
            try { evt.cancelBubble = true } catch (e) { }
            try { evt.returnValue = false } catch (e) { }
           // 在 jQuery 裡上面四行 可以用一行 return false; 就可
        });

 
More...
darren, 2014/7/17 下午 04:29:34
|< 123 >|
頁數 2 / 3 上一頁 下一頁
~ Uwinfo ~