http://developer.51cto.com/art/200907/140267.htm


amychang2014 發表在 痞客邦 留言(0) 人氣()

  一、先用Vistual Studio Utimate的SQL Schema比對測試機DB和正式機DB差異。
二、與PM討論是否需要停機

amychang2014 發表在 痞客邦 留言(0) 人氣()

PageBase.cs

using System;

amychang2014 發表在 痞客邦 留言(0) 人氣()

<input type='file' value='C:\fakepath' />

 

amychang2014 發表在 痞客邦 留言(0) 人氣()

<input type="file" name="FileUpload1" id="FileUpload1" class="form-control" style="width:400px;" runat="server" />
<img id="testImg" src="#" alt="your image" />
                <script>
                    $(function () {
                        $('#testImg').hide();
                    });
                    function getImgSize(input) {
                        if (input.files && input.files[0]) {
                            var reader = new FileReader();
                            reader.onload = function (e) {
                                $('#testImg').attr('src', e.target.result);
                            }
                            reader.readAsDataURL(input.files[0]);
                        }
                    }

                    $('#testImg').on('load', function () {
                        if (($(this).width() == 77) && ($(this).height() == 50)) {
                        } else {
                            $('#<%=FileUpload1.ClientID%>').val('');
                            alert('※上傳檔案尺寸不符規定※');                                    
                            }
                        })
                        $('#<%=FileUpload1.ClientID%>').change(function () {
                        getImgSize(this);
                    });
                        </script>

amychang2014 發表在 痞客邦 留言(0) 人氣()

<img id="testImg1" src="#" alt="your image" />
                        <img id="testImg2" src="#" alt="your image" />
                        <script>
                            $(function () {
                                $('#testImg1').hide();
                                $('#testImg2').hide();
                            });
                            function getImgSize(input, id) {
                                if (input.files && input.files[0]) {
                                    var reader = new FileReader();
                                    reader.onload = function (e) {
                                        $('#testImg' + id).attr('src', e.target.result);
                                    }
                                    reader.readAsDataURL(input.files[0]);
                                }
                            }
                            $('#testImg1').on('load', function () {
                                if (($(this).width() == 77) && ($(this).height() == 50)) {
                                } else {
                                    $('#<%=FileUpload1.ClientID%>').val('');
                                    alert('※上傳檔案尺寸不符規定1※');
                                }
                            })
                            $('#testImg2').on('load', function () {
                                if (($(this).width() == 77) && ($(this).height() == 50)) {
                                } else {
                                    $('#<%=FileUpload2.ClientID%>').val('');
                                    alert('※上傳檔案尺寸不符規定2※');
                                }
                            })

                            $('#<%=FileUpload1.ClientID%>').change(function () {
                                getImgSize(this, 1);
                            });
                            $('#<%=FileUpload2.ClientID%>').change(function () {
                                getImgSize(this, 2);
                            });
                        </script>

amychang2014 發表在 痞客邦 留言(0) 人氣()

<input type="file" multiple="multiple" name="File1[]" id="File1" accept="image/*" class="yellowButton_fileupload" style="width:200px;" />
                        <script>
                            $(document).ready(function () {
                                $('#<%=按鈕_上傳.ClientID%>').hide();
                            });
                           
                            $('input#File1').change(function () {
                                var files = $(this)[0].files;
                                var size = 0;
                                var check = 0;
                                for (var i = 0; i < files.length; i++) {
                                    size = size + this.files[i].size;
                                    if (this.files[i].size > 1024 * 1024) {
                                        alert('單個檔案大小大於1MB,不允上傳');
                                        $('input#File1').val('');
                                        check = 1;
                                        break;
                                    }
                                }
                                if (check == 0) {
                                    if (size > 1024 * 1024 * 10) {
                                        //alert(size);
                                        alert('您選擇上傳的檔案大小大於10MB,請重新選擇!');
                                        $('input#File1').val('');
                                        $('#<%=按鈕_上傳.ClientID%>').hide();
                                    } else {
                                        //alert('ok');
                                        $('#<%=按鈕_上傳.ClientID%>').show();
                                    }
                                }
                            });
                        </script>

amychang2014 發表在 痞客邦 留言(0) 人氣()

function getImgSize(input) {

if (input.files && input.files[0]) {

amychang2014 發表在 痞客邦 留言(0) 人氣()

http://tgw1029.blogspot.tw/2010/05/chromemaintainscrollpositiononpostback.html


amychang2014 發表在 痞客邦 留言(0) 人氣()

<input type="file" multiple="multiple" name="File1[]" id="File1" accept="image/*" class="yellowButton_fileupload" style="width:200px;" />
                        <script>
                            $('input#File1').change(function () {
                                var files = $(this)[0].files;
                                //alert(files.length);
                                var size = 0;
                                for (var i = 0; i < files.length; i++) {
                                    size = size + this.files[i].size;
                                }
                                if (size > 1024 * 1024 * 10) {
                                    //alert(size);
                                    alert('您選擇上傳的檔案大小大於10MB,請重新選擇!');
                                    $('#<%=按鈕_上傳.ClientID%>').hide();
                                } else {
                                    //alert('ok');
                                    $('#<%=按鈕_上傳.ClientID%>').show();
                                }
                            });
                        </script>

amychang2014 發表在 痞客邦 留言(0) 人氣()