|
この記事は機械翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 詳細情報
|
訳文
原文
|
HtmlElementInsertionOrientation 列挙体
.NET Framework 4.5
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (System.Windows.Forms.dll 内)
public void AddDivMessage() { Uri currentUri = new Uri(webBrowser1.Url.ToString()); String hostName = null; // Ensure we have a host name, and not just an IP, against which to test. if (!(currentUri.HostNameType == UriHostNameType.Dns)) { DnsPermission permit = new DnsPermission(System.Security.Permissions.PermissionState.Unrestricted); permit.Assert(); IPHostEntry hostEntry = System.Net.Dns.GetHostEntry(currentUri.Host); hostName = hostEntry.HostName; } else { hostName = currentUri.Host; } if (!hostName.Contains("adatum.com")) { AddTopPageMessage("You are viewing a web site other than ADatum.com. " + "Please exercise caution, and ensure your Web surfing complies with all " + "corporate regulations as laid out in the company handbook."); } } private void AddTopPageMessage(String message) { if (webBrowser1.Document != null) { HtmlDocument doc = webBrowser1.Document; // Do not insert the warning again if it already exists. HtmlElementCollection returnedElems = doc.All.GetElementsByName("ADatumWarningDiv"); if ((returnedElems != null) && (returnedElems.Count > 0)) { return; } HtmlElement divElem = doc.CreateElement("DIV"); divElem.Name = "ADatumWarningDiv"; divElem.Style = "background-color:black;color:white;font-weight:bold;width:100%;"; divElem.InnerText = message; divElem = doc.Body.InsertAdjacentElement(HtmlElementInsertionOrientation.AfterBegin, divElem); } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (サーバー コア ロールはサポート対象外), Windows Server 2008 R2 (SP1 以降でサーバー コア ロールをサポート。Itanium はサポート対象外)
.NET Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。