Toggle navigation
(株)SSKPC
SSPCのブログ
アクセス
お問い合わせ
各種記事
ソフト開発
ホーム
スマホ判定
次の文書
参考:http://blog.shibayan.jp/entry/20131209/1386598865
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CheckBrowserCaps()
End Sub
Function CheckBrowserCaps()
Dim labelText As String = ""
Dim myBrowserCaps As System.Web.HttpBrowserCapabilities = Request.Browser
If (CType(myBrowserCaps, System.Web.Configuration.HttpCapabilitiesBase)).IsMobileDevice Then
labelText = "Browser is a mobile device."
'Response.Redirect("http://www.sskpc.net/sumaho/test01.aspx")
Server.Transfer("test01.aspx", True)
Else
labelText = "Browser is not a mobile device."
End If
Label1.Text = labelText
'// iPhone もしくは、Android と Mobile を同時に含む時はスマートフォン
If Request.UserAgent.Contains("iPhone") Or (Request.UserAgent.Contains("Android") And Request.UserAgent.Contains("Mobile")) Then
Label2.Text = "Browser is a mobile device2."
'Response.Redirect("http://www.sskpc.net/sumaho/test01.aspx")
Server.Transfer("test01.aspx", True)
End If
'
End Function 'CheckBrowserCaps
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim s As String = ""
With Request.Browser
s &= "Browser Capabilities" & "<br>"
s &= "Type = " & .Type & "<br>"
s &= "Name = " & .Browser & "<br>"
s &= "Version = " & .Version & "<br>"
s &= "Major Version = " & .MajorVersion & "<br>"
s &= "Minor Version = " & .MinorVersion & "<br>"
s &= "Platform = " & .Platform & "<br>"
s &= "Is Beta = " & .Beta & "<br>"
s &= "Is Crawler = " & .Crawler & "<br>"
s &= "Is AOL = " & .AOL & "<br>"
s &= "Is Win16 = " & .Win16 & "<br>"
s &= "Is Win32 = " & .Win32 & "<br>"
s &= "Supports Frames = " & .Frames & "<br>"
s &= "Supports Tables = " & .Tables & "<br>"
s &= "Supports Cookies = " & .Cookies & "<br>"
s &= "Supports VBScript = " & .VBScript & "<br>"
s &= "Supports JavaScript = " & _
.EcmaScriptVersion.ToString() & "<br>"
s &= "Supports Java Applets = " & .JavaApplets & "<br>"
s &= "Supports ActiveX Controls = " & .ActiveXControls & _
"<br>"
End With
Label3.Text = s
End Sub
End Class
コメント入力欄
← 左の文字をここへ入力後 登録ボタンをクリックしてください
(サイト管理者承認後掲載されます)
サイト内記事検索
asp.net
動的画像作成(ファイル出力)
動的画像作成(棒グラフ)
動的画像作成(背景)
孫ページから子マスターページのカレンダーのプロパティ変更
カレンダーの日付クリックで他のページを表示する
複数のボタンがあるフォームで検証コントロールを使い分ける
asp.net で テキストボックスのオートコンプリート機能を実装する
マスターページのイベントでコンテンツページに値設定
動的な配列コントロール イメージ編
ListViewでDBにある画像からサムネイル一覧を作成する2
ListViewでDBにある画像からサムネイル一覧を作成する1
動的な配列コントロール3
動的な配列コントロール2
動的な配列コントロール1 LABEL TEXTBOX BUTTON
動的な配列コントロール5
動的な配列コントロール4
グループ化し件数を求める
スマホ判定
改行マークをWebタグへ変換する
ホスト名からIPアドレスを取得する
孫ページから子マスターページの参照
親ページから子ページを参照
テキストボックスにフォーカスをセットする(Page.SetFocus)
Locale ID / ロケール ID / LCID
ページ表示の初回のロジック
ImageButtonの onmouseout onmouseover で画像を入れ替える
POSTデータの容量変更
コードの行番号を表示するには
日付から曜日を求める
DropDownList1.SelectedItem.Value
コンテンツページから、マスターページ参照する
マスターページから、コンテンツページを参照する
文字列を数値に変換する
Refresh 他のページへ転送
StrConv
コンテンツの表示/非表示
文字列の置き換え
使用言語を指定する
動的にタイトルを変更したい
<
2024年3月
>
日
月
火
水
木
金
土
25
26
27
28
29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6