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
標籤
  • long
  • datetime O
  • UWInfo Blo
  • SQL
  • 10
  • images
  • timeout212
  • CSP
  • Deadlock
  • C
  • fancybox
  • 黑貓 EGS
  • 1
  • 有潛在危險 Requ
  • 976
  • find
  • 728
  • ie
  • for
  • .,
  • date[t]
  • List
  • regex
  • 7307
  • jsonconver
  • 德蒄
  • SU
  • orm
  • inertSQL
  • UNT
  • Print
  • fortinet
  • iis
  • 0
  • 872
  • 要求長度
  • server
  • rorate
  • 內碼
  • exception
  • �
  • wacs
  • 火狐
  • 黑貓 EGS
  • timeout
  • response
  • AD
  • [t]
  • write
  • .
頁數 5 / 5 上一頁
搜尋 for 結果:
程式技巧: 以字串陣列來取代拼字串
最近看到一些 javascript 範例 覺得這樣不錯的
就是用 array push, join 方式來拼字串

    var Data = [{"key": "key5", "value": "value5"}, {"key": "key4", "value": "value4"}, {"key": "key3", "value": "value3"}];
    var html = [];
    html.push('<select name="test">');
    for (var i = 0; i < Data.length; i++) {
        html.push('<option value="' + Data[i]["key"] + '">',
            Data[i]["value"],
            "</option>");
    }
    html.push('</select>');
    return html.join('');


同樣的方式 .net 也可以這樣做

        List<string> listOfString = new List<string>();
        for (int i = 0; i < 10; i++)
        {
            listOfString.Add(i.ToString());
        }
        string strResult = string.Join(", ", listOfString.ToArray());


用這種方式也省的判別最後一筆要不要加上分隔符號
More...
darren, 2012/10/17 下午 04:09:20
global.asax 的事件
從 http://blog.ie-soft.de/post/2007/12/globalasax-events.aspx  抄來的. 留作參考

HttpApplication Events:

Application_AcquireRequestState
Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request. 

Application_AuthenticateRequest
Occurs when a security module has established the identity of the user. 

Application_AuthorizeRequest
Occurs when a security module has verified user authorization. 

Application_BeginRequest
Occurs as the first event in the HTTP pipeline chain of execution when ASP.NET responds to a request. 

Application_Disposed
Adds an event handler to listen to the Disposed event on the application. 

Application_EndRequest
Occurs as the last event in the HTTP pipeline chain of execution when ASP.NET responds to a request. 

Application_Error
Occurs when an unhandled exception is thrown. 

Application_PostAcquireRequestState
Occurs when the request state (for example, session state) that is associated with the current request has been obtained. 

Application_PostAuthenticateRequest
Occurs when a security module has established the identity of the user. 

Application_PostAuthorizeRequest
Occurs when the user for the current request has been authorized. 

Application_PostMapRequestHandler
Occurs when ASP.NET has mapped the current request to the appropriate event handler. 

Application_PostReleaseRequestState
Occurs when ASP.NET has completed executing all request event handlers and the request state data has been stored. 

Application_PostRequestHandlerExecute
Occurs when the ASP.NET event handler (for example, a page or an XML Web service) finishes execution. 

Application_PostResolveRequestCache
Occurs when ASP.NET bypasses execution of the current event handler and allows a caching module to serve a request from the cache. 

Application_PostUpdateRequestCache
Occurs when ASP.NET completes updating caching modules and storing responses that are used to serve subsequent requests from the cache. 

Application_PreRequestHandlerExecute
Occurs just before ASP.NET begins executing an event handler (for example, a page or an XML Web service). 

Application_PreSendRequestContent
Occurs just before ASP.NET sends content to the client. 

Application_PreSendRequestHeaders
Occurs just before ASP.NET sends HTTP headers to the client. 

Application_ReleaseRequestState
Occurs after ASP.NET finishes executing all request event handlers. This event causes state modules to save the current state data. 

Application_ResolveRequestCache
Occurs when ASP.NET completes an authorization event to let the caching modules serve requests from the cache, bypassing execution of the event handler (for example, a page or an XML Web service). 

Application_UpdateRequestCache
Occurs when ASP.NET finishes executing an event handler in order to let caching modules store responses that will be used to serve subsequent requests from the cache. 

Application_Init
This method occurs after _start and is used for initializing code. 

Application_Start
As with traditional ASP, used to set up an application environment and only called when the application first starts.

Application_End
Again, like classic ASP, used to clean up variables and memory when an application ends.

Session Events:

Session_Start
As with classic ASP, this event is triggered when any new user accesses the web site.

Session_End
As with classic ASP, this event is triggered when a user's session times out or ends. Note this can be 20 mins (the default session timeout value) after the user actually leaves the site.

Profile Events:

Profile_MigrateAnonymous
Occurs when the anonymous user for a profile logs in.

Passport Events:

PassportAuthentication_OnAuthenticate
Raised during authentication. This is a Global.asax event that must be named PassportAuthentication_OnAuthenticate.
 

Possibly more events defined in other HttpModules like:

System.Web.Caching.OutputCacheModule
System.Web.SessionState.SessionStateModule
System.Web.Security.WindowsAuthentication
System.Web.Security.FormsAuthenticationModule
System.Web.Security.PassportAuthenticationModule
System.Web.Security.UrlAuthorizationModule
System.Web.Security.FileAuthorizationModule
System.Web.Profile.ProfileModule

More...
Bike, 2012/6/9 上午 08:55:08
在列印前把列印的內容使用圖檔存備份
主要是使用 Printing.PreviewPrintController 的產生預覽圖片的功能來儲存列印內容, 再把圖片送到印表機, 以保証列印內容和儲存的圖檔是一致的. 值得一提的是, 在預覽時可以使用不同的印表機, 以便讓產生較小的圖檔, 否則有時會發生 GDI+ 的錯誤.

Sample 如下:

Imports System.Drawing.Printing

Namespace X
    Partial Public Class PrintSomething
        Dim PD As PrintDocument

        Dim ppc As New Printing.PreviewPrintController()

        Dim TotalPage As Int32 = 0

        ''' <summary>
        ''' 第幾次列印, 用來控制寫出的圖檔
        ''' </summary>
        ''' <remarks></remarks>
        Dim PrintCount As Int32 = 1

        Dim PageCount As Int32 = 1

            :
            :
            :
      
        Sub New(ByVal oPM As DB.PackingListMain, ByVal dtDetail As DataTable, dtUsedCoupon As DataTable)
            '初始化資料
            :
            :
            :
        End Sub

        Sub InitPrintDocument()
            '在這裡設定 PrintDocument 的紙張, 印表機, 邊界, 橫印或直印

            PD = New PrintDocument

            :
            :
            :

        End Sub

        Sub print()
            InitPrintDocument()

            PD.PrintController = ppc

           
            ' 第一次先把列印結果存在 Printing.PreviewPrintController 中
            AddHandler PD.PrintPage, AddressOf GeneratePreview

            '再來儲存圖片
            AddHandler PD.EndPrint, AddressOf SaveImage

            PD.Print()
        End Sub


        Dim ppi() As Printing.PreviewPageInfo
        Dim PrintPage As Int32 = 0

        Sub SaveImage(ByVal sender As Object, ByVal ev As PrintEventArgs)

            PrintDebug("Save Image Start, " & Now.ToString("yyyy-MM-dd HH:mm:ss.fff"))

            '把圖檔存起來
            Dim TF As String = Now.ToString("yyyyMMddHHmmss") ' DB.SysConfig.Path.LocalDataRoot
            Dim PathLocal As String = "C:\PrintLog\" & TF.Substring(0, 4) & "-" & TF.Substring(4, 2) & "\"
            Dim PathPackingListSheetImage As String = DB.SysConfig.PackingListSheetImage & TF.Substring(0, 4) & "-" & TF.Substring(4, 2) & "\"

            System.IO.Directory.CreateDirectory(PathLocal)
            System.IO.Directory.CreateDirectory(PathPackingListSheetImage)

            Dim LatestImages As String = ""
            ppi = ppc.GetPreviewPageInfo()

            For x As Integer = 0 To ppi.Length - 1
                Dim Filename As String = TF & "_" & Me.oPM.Id & "_" & x & ".png"

                ppi(x).Image.Save(PathLocal & Filename, System.Drawing.Imaging.ImageFormat.Png)
            Next


            '把圖檔印出來
            For x As Integer = 0 To ppi.Length - 1
  '建立新的 PrintDocument
                InitPrintDocument()

                If CST.WebConfig.Server_NAME = "測試主機" Then
                    UW.WU.DebugWriteLine("PrinterName: " & Me.PD.PrinterSettings.PrinterName)
                    UW.WU.DebugWriteLine("PaperSize: " & PD.DefaultPageSettings.PaperSize.PaperName)

                    PD.DocumentName = "PackingList"
                    PD.PrinterSettings.PrintFileName = "C:\PDF\PackingList" & Now.ToString("yyyyMMddHHmmss") & "_" & PrintPage & ".prn"
                    PD.PrinterSettings.PrintToFile = True

                    'PD.PrinterSettings.
                End If

                '很奇怪, 這裡不會分頁, 所以要一張一張印   
                AddHandler PD.PrintPage, AddressOf pd_PrintPage2
                PD.Print()


               PrintPage += 1

            Next
        End Sub

        Private Sub pd_PrintPage2(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
            '很奇怪, 這裡不會分頁, 所以要一張一張印           
            ev.Graphics.DrawImage(ppi(PrintPage).Image, 0, 0)
            ev.HasMorePages = False
        End Sub


        Private Sub GeneratePreview(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
            ' 列印內容
        End Sub

        End Class
    End Class

End Namespace

More...
Bike, 2012/5/3 下午 04:00:38
C#
#Region => 區塊作用說明

EX.

#region Configure for Content Provider  =>區塊說明,在程式裡不會work

//Settings for Cotent Provider (for Alpha Enviroment)
string szCID = xmlDoc.DocumentElement["CID"].InnerText;
string szKey = "z1okwCmRSkgk/vkWzxIuwQNuUvf9d8gj";
string szIV = "dg454KArm6g=";
string szPassword = "1234";

#endregion

More...
Reiko, 2012/4/30 下午 12:25:30
安裝awstats

http://nani.uwinfo.com.tw/?p=197

http://ssorc.tw/rewrite.php/read-631.html

安裝 GeoIP:

安裝 Perl 模組
在 cmd 下, 輸入 "ppm install Geo-IP-PurePerl"

下載 Data:

1. Install Perl module.  Open your Perl Package Manager which is stand for ppm.bat in bin folder.
2. Install Geo-IP-PurePerl and Geo-IPfree module.
3. Download the GeoIP data from, http://www.maxmind.com/download/geoip/database/. (要 dat 的格式, 不要 csv 的)
4. Extract the data and place it to C:\Perl\lib\Geo\IP folder.
5. Open the awstats.base.conf(C:\awstats\wwwroot\cgi-bin) and paste the following command.

LoadPlugin="geoip GEOIP_STANDARD C:\Perl\lib\Geo\IP\GeoIP.dat"


6. You have done and you will see the result in next update.

 

More...
Reiko, 2012/4/13 下午 07:28:25
|< 12345 >|
頁數 5 / 5 上一頁
~ Uwinfo ~