10/03/2021

Kiểm tra 1 trang web có cho phép mở trong iframe hay không bằng c#

 Khi cần nhúng 1 trang web (URL) khác vào website của bạn dưới dạng iframe

Nếu website đó không cho phép mở dưới dạng iframe, website bạn sẽ hiển thị lỗi :)

Bạn cần kiểm tra trước để hiển thị phù hợp, code c# có thể dùng như sau:

//using using System.Net;

//check frame support

                    string frame_support;

                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(iframeUrl);

                    using (WebResponse response = request.GetResponse())

                    {

                        //DENY, SAMEORIGIN, ALLOW-FROM

                        //null is open in iframe

                        frame_support = response.Headers["X-Frame-Options"];

                    }

25/02/2021

Dạo phố Việt Trì 25 Tết Tân Sửu


Đi dạo phố với dream II Thái tèn tèn chậm chậm 5km/1h :)

————
Nguyễn Minh Tuấn
skype: tuan.net
mobile: 038 68 68 247

17/01/2021

Ultra Office miễn phí dùng cho word, excel, power point và pdf

 

Ultra office

tỷ năm mới cần dùng đến word, làm biếng crack MS Office, không muốn mua MS Office 365 cũng không muốn dùng GG drive hay SkyDrive

tìm linh tinh ra cái Ultra Office miễn phí này, đúng ngon bổ rẻ, dùng tốt cho yêu cầu soạn thảo văn bản đơn giản của mình (y)

link cài đặt cho windows 10:
https://www.microsoft.com/vi-vn/p/ultra-office-for-free-word-spreadsheet-slide-pdf-compatible/9n161bjrlc1d 

06/01/2021

Convert list object to DataTable

//Chuyển đổi listObject thành data table tương ứng
private static DataTable ConvertToDataTable<T>(List<T> models)
        {
            // creating a data table instance and typed it as our incoming model  
            // as I make it generic, if you want, you can make it the model typed you want.  
            DataTable dataTable = new DataTable(typeof(T).Name);

            //Get all the properties of that model  
            PropertyInfo[] Props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);

            // Loop through all the properties              
            // Adding Column name to our datatable  
            foreach (PropertyInfo prop in Props)
            {
                //Setting column names as Property names    
                dataTable.Columns.Add(prop.Name);
            }
            // Adding Row and its value to our dataTable  
            foreach (T item in models)
            {
                var values = new object[Props.Length];
                for (int i = 0; i < Props.Length; i++)
                {
                    //inserting property values to datatable rows    
                    values[i] = Props[i].GetValue(item, null);
                }
                // Finally add value to datatable    
                dataTable.Rows.Add(values);
            }
            return dataTable;
        }

21/12/2020

Sách hay 2021

Những cuốn sách đã và sẽ đọc trong năm 2021
  1. Thành Cát Tư Hãn

    2. BigData _ 16/01/2021
    3. Tiền tập 1&2 đọc lại
    4. Thằng cười đọc lại
    5. Năng Đoạn Kim Cương (Tái Bản 2020)
    6. Vị tu sỹ bán chiếc Ferrari
    7. Rèn luyện tư duy phản biện

Đăng ký tên miền, hosting, máy chủ, thiết kế lập trình website theo yêu cầu

 Chính thức trở thành đơn vị cung cấp dịch vụ đăng ký tên miền quốc tế, tên miền Việt Nam hosting, máy chủ, cloud hosting, cloud server, ema...