TAILIEUCHUNG - ASP.NET 4 Unleased - p 157

Sau khi sửa đổi này đến một máy chủ từ xa, bạn có thể lấy các thiết lập cấu hình (và sửa đổi) trên máy chủ từ xa bằng cách sử dụng một trong những phương pháp mở tiếp xúc bởi lớp WebConfigurationManager. Ví dụ, các trang trong Ví dụ 34,13 chứa một hình thức cho phép bạn nhập vào một máy chủ, tên người dùng và mật khẩu. | 1534 CHAPTER 34 Configuring Applications NOTE If you open the SDK Command Prompt or the Visual Studio Command Prompt you don t need to navigate to the folder to execute the aspnet_regiis tool. After you make this modification to a remote server you can retrieve and modify configuration settings on the remote server by using one of the Open methods exposed by the WebConfigurationManager class. For example the page in Listing contains a form that enables you to enter a server username and password. When you submit the form the page connects to the remote server and retrieves its file. The page displays the current value of the remote server s authentication mode see Figure . FIGURE Changing configuration settings for a remote server. LISTING @ Page Language C @ Import Namespace DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD script runat server protected void btnSubmit_Click object sender EventArgs e try From the Library of Wow eBook Using the Configuration API 1535 Configuration config Configuration null Authenticationsection section AuthenticationSection config. GetSection authentication catch Exception ex script html xmlns http 1999 xhtml head id Head1 runat server title Show Config Remote title head body form id form1 runat server div 34 asp Label id lblServer Text Server AssociatedControlID txtServer Runat server br asp TextBox id txtServer Runat server br br asp Label id lblUserName Text User Name AssociatedControlID txtUserName Runat server br asp TextBox id txtUserName Runat server br br asp Label id lblPassword Text Password AssociatedControlID txtPassword Runat server From the Library of Wow eBook 1536 CHAPTER

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.