Friday, March 22, 2013

Script Backup MS SqlServer

-- Backup Database to .bak File
DECLARE @fileName VARCHAR(90);
DECLARE @db_name VARCHAR(20);
DECLARE @fileDate VARCHAR(20);

SET @fileName = 'D:\backups\'-- change to the relevant path 
SET @db_name = 'my_db';     -- change to the relevant database name 
SET @fileDate = CONVERT(VARCHAR(20), GETDATE(),112);
SET @fileName = @fileName + @db_name + '_' + RTRIM(@fileDate) + '.bak';

BACKUP DATABASE @db_name TO DISK = @fileName; 


sqlcmd -S SQLEXPRESS\AMPER -i "D:\DBA_scripts\backup_database.sql" 

Friday, March 15, 2013

3 thủ thuật câu "Like" facebook hướng dẫn đầy đủ và chi tiết

Facebook ‘Like’ là một công cụ mạnh mẽ mà bạn có thể sử dụng căn bản để tăng lượng người hâm mộ cho các thương hiệu, các công ty và các sản phẩm của bạn. Là một phần của chiến lược tiếp thị cho nhiều trang, nút Like Cũng được sử dụng như là một 'cổng' trước khi bất kỳ khách hàng có khả năng được xem thông tin chi tiết hoặc thực hiện tải về.




Thực tế, có ba hành động mà bạn có thể lập trình nút 'Like' để làm. Nó có thể là một cổng chuyển hướng, cho phép tải cũng như tiết lộ một trang web. Và chúng tôi sẽ cho bạn thấy làm thế nào trong hướng dẫn này.

# 1. Tạo một cổng Like
Bạn có thể sử dụng nút 'Like' như là một 'cổng' sẽ ẩn nội dung gốc của bạn từ công chúng. Độc giả muốn truy cập đến nội dung đầy đủ có sẵn trên trang Facebook phải "Like" trang đầu tiên. Về mặt kỹ thuật, đây là cách đơn giản nhất để đạt được "Likes"





Tạo một cổng Like với Woobox
Với Woobox, bạn đơn giản là có thể cài đặt các ứng dụng đến trang Facebook của bạn và bắt đầu tạo ra các tab với một cổng "Like", miễn phí.


  1. Để bắt đầu đến websites của Woobox và click vào nút đăng ký.
  2. Đăng ký tài khoản Facebook của bạn/





  1. Bạn sẽ được chuyển hướng đến trang mà bạn có thể bắt đầu cài đặt ứng dụng Woobox của bạn. Trên menu bên trái, bấm HTML Fangates.


  2. Nếu bạn đã có các tab được tạo ra với Woobox, nó sẽ được liệt kê ở đây. Để tạo ra một tab mới với một cổng Like, nhấp vào liên kết ở phía dưới Add a new HTML Fangate Tab


    .
  3. Bạn sẽ nhận được một thông báo nói rằng tab mới của bạn đã được tạo ra. Bây giờ bạn có thể chỉnh sửa tab của bạn ở đây hoặc trực tiếp từ trang Facebook của bạn.


  4. Để làm cho nó trực quan hơn cho bạn, hãy vào trang Facebook của bạn, nơi các tab đã được thêm vào, tìm các tab mới và click vào nó.


  5. Nhấp chuột vào nút ‘Authorize’ để tiến hành
  6. Sau khi ủy quyền, bạn sẽ được chuyển hướng đến trang cài đặt của nội dung Tab . Cuộn xuống phía dưới và bạn sẽ thấy phần chính nơi bạn có thể thiết lập nội dung trang của bạn dưới 'Source' và sau đó thiết lập ‘Non-Fan Page Source’.


    .

    ‘Non-Fan Page Source’ sẽ hoạt động như cổng Like.




    ‘Page Source’ là những gì fan hâm mộ của bạn sẽ thấy. Một khi họ "Like: trang của bạn, nội dung mà bạn đã thiết lập vào ‘Page Source’ sẽ xuất hiện.


  7. Khi bạn đã hoàn thành các hình thức với nội dung có liên quan, không quên để di chuyển xuống và bấm vào nútSave Settings .
  8. Sau khi lưu lại, Tab của bạn đã sẵn sàng với một cổng Like ! Đó là cách dễ dàng, và click vào nút View Tab để xem kết quả cuối cùng của bạn.


  9. Trong trang này, như là admin, bạn sẽ thấy ‘Admin Tab Options’ở trên cùng của nội dung của bạn. Nhấp vào View as Non-Fan để xem trước nội dung của non-Fans của bạn.







# 2. Tạo 'Like To Download ' 

‘Like to download’, cũng có chức năng giống như một 'cổng' trước khi 'download' có thể được thực hiện. Nếu bạn có một phần mềm miễn phí để cung cấp cho khách truy cập trang web của bạn, bạn có thể yêu cầu họ click vào nút "Like" trước khi họ có thể thực hiện bất kỳ tải về. Các link để tải về sẽ chỉ xuất hiện sau khi một người nhấp vào ‘Like’.







Để làm điều này,đến trang chính thức 
Facebook Like To Download, di chuyển xuống và điền vào các mẫu đơn giản với địa chỉ trang Facebook của bạn hoặc địa chỉ trang web mục tiêu, sau đó cung cấp các liên kết để tải về, thiết lập chiều rộng và màu sắc ưa thích và sau đó nhấn nút‘Create Your Like Gate Now’.





Sau đó bạn sẽ được xem trước cùng với mã làm việc. Sao chép mã nhúng và dán nó vào trang web hoặc blog của bạn.




Sau khi thêm mã vào trang web của bạn, khách truy cập của bạn sẽ thấy các hướng dẫn để Like trước khi tải về có thể được thực hiện, và một khi họ nhấp vào "Like", nút download sẽ xuất hiện.


.


# 3. Tạo 'Like Để chuyển hướng'' (Đến một trang khác nhau)

‘Like to redirect’ sẽ giúp bạn chuyển hướng truy cập của bạn đến một trang bên ngoài hay trang web sau khi nhấp vào nút ' Like ' trên trang Facebook Tap của bạn. Bây giờ, thay vì chuẩn bị một trang đích hoặc "page source", bạn thực sự có thể chuyển hướng người hâm mộ mới tới trang đích của riêng bạn sau khi họ bấm vào nút 'Like'.






Tạo 'Like To Redirect; với ​​Woobox
Để chuyển hướng với Woobox, theo phần đầu của bài viết này cho đến'Bước 8' dưới ‘Page Source‘, chọn ‘Redirect‘. Điền vào các trang bên ngoài với các URL mà bạn muốn chuyển hướng người hâm mộ của bạn.


.


Đừng quên để thiết lập Non-fan page source’, và lưu các thiết lập. Bây giờ, bất cứ khi nào một người nhấp chuột vào nút 'Like' từ trang tab này, họ sẽ được chuyển đi từ Facebook, đến các URL mà bạn chỉ định.




Lưu ý:
 Facebook thay đổi hầu hết các tính năng của nó mọi lúc, và trước đó bạn cũng có thể chuyển hướng người dùng thích trang của bạn trực tiếp từ trang web của bạn, nó có vẻ khó khăn để đạt được khi Facebook bổ pop-up bật lên tùy chọn 'chia sẻ' bất cứ khi nào bạn nhấp vào ‘Like’.

Kết luận
Với những thủ thuật, bạn sẽ có thể đạt được nhiều "Likes" trên Facebook và tăng lượng fan hâm mộ của bạn. Yêu cầu họ muốn trước khi tải về như là một dấu hiệu của sự đánh giá cao, hoặc chuyển hướng họ đến một trang cung cấp đặc biệt sau khi nhấp vào "Like".


http://forum.idichvuseo.com/social-marketing-tiep-thi-qua-mang-xa-hoi-20/3-thu-thuat-cau-like-facebook-huong-dan-day-du-va-chi-tiet-9996/#.UULYcBzIYbp

OAuth/OpenID Support for WebForms, MVC and WebPages


One of the coolest features in Visual Studio 2012 is the ability to login using your Microsoft, Facebook, Twitter or Google account. The project templates showcase a social way of logging in along with the usual way of logging in by creating a local account
This post highlights how you can turn on support for logging through these services in the project  templates. Head over the following video to get a quick glance on this feature http://www.asp.net/vnext/overview/videos/oauth-in-the-default-aspnet-45-templates

Enable OAuth login using Facebook, Twitter

Steps to get keys for Facebook
  • Go to the Facebook developers site (log in if you're not already logged in).
  • Choose the Create New App button, and then follow the prompts to name and create the new application.
  • In the section Select how your app will integrate with Facebook, choose the Website section.
  • Fill in the Site URL field with the URL of your site (for example, http://www.example.com). The Domain field is optional; you can use this to provide authentication for an entire domain (such as example.com).
    Note   If you are running a site on your local computer with a URL like http://localhost:12345 (where the number is a local port number), you can add this value to the Site URL field for testing your site. However, any time the port number of your local site changes, you will need to update the Site URL field of your application.
  • Choose the Save Changes button.
  • Choose the Apps tab again, and then view the start page for your application.
  • Copy the App ID and App Secret values for your application and paste them into a temporary text file. You will pass these values to the Facebook provider in your website code.
  • Exit the Facebook developer site.
Steps to get keys for Twitter
  • Browse to the Twitter developers site.
  • Choose the Create an App link and then log into the site.
  • On the Create an Application form, fill in the Name and Description fields.
  • In the WebSite field, enter the URL of your site (for example, http://www.example.com).
    Note   If you're testing your site locally (using a URL like http://localhost:12345), Twitter might not accept the URL. However, you might be able to use the local loopback IP address (for example http://127.0.0.1:12345). This simplifies the process of testing your application locally. However, every time the port number of your local site changes, you'll need to update the WebSite field of your application.
  • In the Callback URL field, enter a URL for the page in your website that you want users to return to after logging into Twitter. For example, to send users to the home page of the Starter Site (which will recognize their logged-in status), enter the same URL that you entered in the WebSite field.
  • Accept the terms and choose the Create your Twitter application button.
  • On the My Applications landing page, choose the application you created.
  • On the Details tab, scroll to the bottom and choose the Create My Access Token button.
  • On the Details tab, copy the Consumer Key and Consumer Secret values for your application and paste them into a temporary text file. You'll pass these values to the Twitter provider in your website code.
  • Exit the Twitter site.

Steps to enable OAuth support in WebForms

    • Create a new ASP.NET WebForms Application
    • Goto App_Start\AuthConfig.cs and uncomment the following lines of code
OpenAuth.AuthenticationClients.AddTwitter(
                 consumerKey: "your Twitter consumer key",
                 consumerSecret: "your Twitter consumer secret");
 
            OpenAuth.AuthenticationClients.AddFacebook(
                 appId: "your Facebook app id",
                 appSecret: "your Facebook app secret");

Steps to enable OAuth support in MVC

    • Create a new ASP.NET MVC Internet Application
    • Goto App_Start\AuthConfig.cs and uncomment the following lines of code
//OAuthWebSecurity.RegisterTwitterClient(
            // consumerKey: "",
            // consumerSecret: "");
 
            //OAuthWebSecurity.RegisterFacebookClient(
            // appId: "",
            //    appSecret: "");

Steps to enable OAuth support in WebPages

    • Create a new ASP.NET WebSite(Razor2)
    • Goto _AppStart.cshtml and uncomment the following lines of code
//OAuthWebSecurity.RegisterTwitterClient(
            // consumerKey: "",
            // consumerSecret: "");
 
            //OAuthWebSecurity.RegisterFacebookClient(
            // appId: "",
            //    appSecret: "");

OpenID services such as Google

Steps to enable OpenID support in WebForms

  • Create a new ASP.NET WebForms Application
  • Goto App_Start\AuthConfig.cs and uncomment the following lines of code
OpenAuth.AuthenticationClients.AddGoogle();

Steps to enable OpenID support in MVC

  • Create a new ASP.NET MVC Internet Application
  • Goto App_Start\AuthConfig.cs and uncomment the following lines of code
OAuthWebSecurity.RegisterGoogleClient();

Steps to enable OpenID support in WebPages

  • Create a new ASP.NET WebSite(Razor2)
  • Goto _AppStart.cshtml and uncomment the following lines of code
OAuthWebSecurity.RegisterGoogleClient();

Links to relevant posts

Happy Logging in a social way!!!

http://blogs.msdn.com/b/webdev/archive/2012/08/15/oauth-openid-support-for-webforms-mvc-and-webpages.aspx