Changeset 21380

Show
Ignore:
Timestamp:
10/15/08 18:46:47 (5 years ago)
Author:
kiri_feather
Message:

プロキシ設定追加

Location:
lang/vb2005/Tween/Tween
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • lang/vb2005/Tween/Tween/MyCommon.vb

    r21157 r21380  
    3030    End Enum 
    3131 
     32    Public Enum ProxyTypeEnum 
     33        None 
     34        IE 
     35        Specified 
     36    End Enum 
    3237End Module 
  • lang/vb2005/Tween/Tween/MySocket.vb

    r21257 r21380  
    1010    Private _uid As String 
    1111    Private _pwd As String 
     12    Private _proxy As System.Net.WebProxy 
     13    Private _proxyType As ProxyTypeEnum 
    1214 
    1315    Public Enum REQ_TYPE 
     
    2527    End Enum 
    2628 
    27     Public Sub New(ByVal EncodeType As String, Optional ByVal Username As String = "", Optional ByVal Password As String = "") 
     29    Public Sub New(ByVal EncodeType As String, _ 
     30            ByVal Username As String, _ 
     31            ByVal Password As String, _ 
     32            ByVal ProxyType As ProxyTypeEnum, _ 
     33            ByVal ProxyAddress As String, _ 
     34            ByVal ProxyPort As Integer, _ 
     35            ByVal ProxyUser As String, _ 
     36            ByVal ProxyPassword As String) 
    2837        _enc = Encoding.GetEncoding(EncodeType) 
    2938        ServicePointManager.Expect100Continue = False 
     
    3443            _pwd = Password 
    3544        End If 
     45        Select Case ProxyType 
     46            Case ProxyTypeEnum.None 
     47                _proxy = Nothing 
     48            Case ProxyTypeEnum.Specified 
     49                _proxy = New WebProxy("http://" + ProxyAddress + ":" + ProxyPort.ToString) 
     50                If ProxyUser <> "" Or ProxyPassword <> "" Then 
     51                    _proxy.Credentials = New NetworkCredential(ProxyUser, ProxyPassword) 
     52                End If 
     53                'IE�ݒ��V�X�e���ݒ��̓f�t�H���g�l�Ȃ̂ŏ������Ȃ� 
     54        End Select 
     55        _proxyType = ProxyType 
    3656    End Sub 
    3757 
     
    6080            If reqType = REQ_TYPE.ReqGetNoCache Then 
    6181                webReq.CachePolicy = cpolicy 
     82            End If 
     83            If _proxyType <> ProxyTypeEnum.IE Then 
     84                webReq.Proxy = _proxy 
    6285            End If 
    6386 
  • lang/vb2005/Tween/Tween/Setting.Designer.vb

    r21368 r21380  
    142142        Me.TabPage3 = New System.Windows.Forms.TabPage 
    143143        Me.TabPage4 = New System.Windows.Forms.TabPage 
     144        Me.TabPage5 = New System.Windows.Forms.TabPage 
     145        Me.GroupBox2 = New System.Windows.Forms.GroupBox 
     146        Me.RadioProxyNone = New System.Windows.Forms.RadioButton 
     147        Me.RadioProxyIE = New System.Windows.Forms.RadioButton 
     148        Me.RadioProxySpecified = New System.Windows.Forms.RadioButton 
     149        Me.LabelProxyAddress = New System.Windows.Forms.Label 
     150        Me.TextProxyAddress = New System.Windows.Forms.TextBox 
     151        Me.LabelProxyPort = New System.Windows.Forms.Label 
     152        Me.TextProxyPort = New System.Windows.Forms.TextBox 
     153        Me.LabelProxyUser = New System.Windows.Forms.Label 
     154        Me.TextProxyUser = New System.Windows.Forms.TextBox 
     155        Me.LabelProxyPassword = New System.Windows.Forms.Label 
     156        Me.TextProxyPassword = New System.Windows.Forms.TextBox 
     157        Me.Label55 = New System.Windows.Forms.Label 
    144158        Me.Label52 = New System.Windows.Forms.Label 
    145159        Me.MaxPost = New System.Windows.Forms.TextBox 
     
    150164        Me.TabPage3.SuspendLayout() 
    151165        Me.TabPage4.SuspendLayout() 
     166        Me.TabPage5.SuspendLayout() 
     167        Me.GroupBox2.SuspendLayout() 
    152168        Me.SuspendLayout() 
    153169        ' 
     
    12151231        Me.TabControl1.Controls.Add(Me.TabPage3) 
    12161232        Me.TabControl1.Controls.Add(Me.TabPage4) 
     1233        Me.TabControl1.Controls.Add(Me.TabPage5) 
    12171234        Me.TabControl1.Location = New System.Drawing.Point(12, 12) 
    12181235        Me.TabControl1.Name = "TabControl1" 
     
    13621379        Me.TabPage4.UseVisualStyleBackColor = True 
    13631380        ' 
     1381        'TabPage5 
     1382        ' 
     1383        Me.TabPage5.Controls.Add(Me.GroupBox2) 
     1384        Me.TabPage5.Location = New System.Drawing.Point(4, 21) 
     1385        Me.TabPage5.Name = "TabPage5" 
     1386        Me.TabPage5.Padding = New System.Windows.Forms.Padding(3) 
     1387        Me.TabPage5.Size = New System.Drawing.Size(372, 437) 
     1388        Me.TabPage5.TabIndex = 4 
     1389        Me.TabPage5.Text = "通信" 
     1390        Me.TabPage5.UseVisualStyleBackColor = True 
     1391        ' 
    13641392        'Label52 
    13651393        ' 
     
    13711399        Me.Label52.Text = "1時間あたりの最大POST回数" 
    13721400        ' 
     1401        'GroupBox2 
     1402        ' 
     1403        Me.GroupBox2.Controls.Add(Me.Label55) 
     1404        Me.GroupBox2.Controls.Add(Me.TextProxyPassword) 
     1405        Me.GroupBox2.Controls.Add(Me.LabelProxyPassword) 
     1406        Me.GroupBox2.Controls.Add(Me.TextProxyUser) 
     1407        Me.GroupBox2.Controls.Add(Me.LabelProxyUser) 
     1408        Me.GroupBox2.Controls.Add(Me.TextProxyPort) 
     1409        Me.GroupBox2.Controls.Add(Me.LabelProxyPort) 
     1410        Me.GroupBox2.Controls.Add(Me.TextProxyAddress) 
     1411        Me.GroupBox2.Controls.Add(Me.LabelProxyAddress) 
     1412        Me.GroupBox2.Controls.Add(Me.RadioProxySpecified) 
     1413        Me.GroupBox2.Controls.Add(Me.RadioProxyIE) 
     1414        Me.GroupBox2.Controls.Add(Me.RadioProxyNone) 
     1415        Me.GroupBox2.Location = New System.Drawing.Point(7, 7) 
     1416        Me.GroupBox2.Name = "GroupBox2" 
     1417        Me.GroupBox2.Size = New System.Drawing.Size(359, 161) 
     1418        Me.GroupBox2.TabIndex = 0 
     1419        Me.GroupBox2.TabStop = False 
     1420        Me.GroupBox2.Text = "プロキシの設定" 
     1421        ' 
    13731422        'MaxPost 
    13741423        ' 
     
    13771426        Me.MaxPost.Size = New System.Drawing.Size(62, 19) 
    13781427        Me.MaxPost.TabIndex = 26 
     1428        ' 
     1429        'RadioProxyNone 
     1430        ' 
     1431        Me.RadioProxyNone.AutoSize = True 
     1432        Me.RadioProxyNone.Location = New System.Drawing.Point(6, 18) 
     1433        Me.RadioProxyNone.Name = "RadioProxyNone" 
     1434        Me.RadioProxyNone.Size = New System.Drawing.Size(76, 16) 
     1435        Me.RadioProxyNone.TabIndex = 0 
     1436        Me.RadioProxyNone.Text = "使用しない" 
     1437        Me.RadioProxyNone.UseVisualStyleBackColor = True 
     1438        ' 
     1439        'RadioProxyIE 
     1440        ' 
     1441        Me.RadioProxyIE.AutoSize = True 
     1442        Me.RadioProxyIE.Checked = True 
     1443        Me.RadioProxyIE.Location = New System.Drawing.Point(6, 40) 
     1444        Me.RadioProxyIE.Name = "RadioProxyIE" 
     1445        Me.RadioProxyIE.Size = New System.Drawing.Size(190, 16) 
     1446        Me.RadioProxyIE.TabIndex = 1 
     1447        Me.RadioProxyIE.TabStop = True 
     1448        Me.RadioProxyIE.Text = "InternetExplorerの設定を使用する" 
     1449        Me.RadioProxyIE.UseVisualStyleBackColor = True 
     1450        ' 
     1451        'RadioProxySpecified 
     1452        ' 
     1453        Me.RadioProxySpecified.AutoSize = True 
     1454        Me.RadioProxySpecified.Location = New System.Drawing.Point(6, 62) 
     1455        Me.RadioProxySpecified.Name = "RadioProxySpecified" 
     1456        Me.RadioProxySpecified.Size = New System.Drawing.Size(66, 16) 
     1457        Me.RadioProxySpecified.TabIndex = 2 
     1458        Me.RadioProxySpecified.Text = "指定する" 
     1459        Me.RadioProxySpecified.UseVisualStyleBackColor = True 
     1460        ' 
     1461        'LabelProxyAddress 
     1462        ' 
     1463        Me.LabelProxyAddress.AutoSize = True 
     1464        Me.LabelProxyAddress.Location = New System.Drawing.Point(38, 81) 
     1465        Me.LabelProxyAddress.Name = "LabelProxyAddress" 
     1466        Me.LabelProxyAddress.Size = New System.Drawing.Size(58, 12) 
     1467        Me.LabelProxyAddress.TabIndex = 3 
     1468        Me.LabelProxyAddress.Text = "プロキシ(&X)" 
     1469        ' 
     1470        'TextProxyAddress 
     1471        ' 
     1472        Me.TextProxyAddress.Location = New System.Drawing.Point(102, 78) 
     1473        Me.TextProxyAddress.Name = "TextProxyAddress" 
     1474        Me.TextProxyAddress.Size = New System.Drawing.Size(135, 19) 
     1475        Me.TextProxyAddress.TabIndex = 4 
     1476        ' 
     1477        'LabelProxyPort 
     1478        ' 
     1479        Me.LabelProxyPort.AutoSize = True 
     1480        Me.LabelProxyPort.Location = New System.Drawing.Point(243, 81) 
     1481        Me.LabelProxyPort.Name = "LabelProxyPort" 
     1482        Me.LabelProxyPort.Size = New System.Drawing.Size(48, 12) 
     1483        Me.LabelProxyPort.TabIndex = 5 
     1484        Me.LabelProxyPort.Text = "ポート(&P)" 
     1485        ' 
     1486        'TextProxyPort 
     1487        ' 
     1488        Me.TextProxyPort.Location = New System.Drawing.Point(297, 78) 
     1489        Me.TextProxyPort.Name = "TextProxyPort" 
     1490        Me.TextProxyPort.Size = New System.Drawing.Size(45, 19) 
     1491        Me.TextProxyPort.TabIndex = 6 
     1492        ' 
     1493        'LabelProxyUser 
     1494        ' 
     1495        Me.LabelProxyUser.AutoSize = True 
     1496        Me.LabelProxyUser.Location = New System.Drawing.Point(62, 106) 
     1497        Me.LabelProxyUser.Name = "LabelProxyUser" 
     1498        Me.LabelProxyUser.Size = New System.Drawing.Size(63, 12) 
     1499        Me.LabelProxyUser.TabIndex = 7 
     1500        Me.LabelProxyUser.Text = "ユーザ名(&U)" 
     1501        ' 
     1502        'TextProxyUser 
     1503        ' 
     1504        Me.TextProxyUser.Location = New System.Drawing.Point(131, 103) 
     1505        Me.TextProxyUser.Name = "TextProxyUser" 
     1506        Me.TextProxyUser.Size = New System.Drawing.Size(68, 19) 
     1507        Me.TextProxyUser.TabIndex = 8 
     1508        ' 
     1509        'LabelProxyPassword 
     1510        ' 
     1511        Me.LabelProxyPassword.AutoSize = True 
     1512        Me.LabelProxyPassword.Location = New System.Drawing.Point(205, 106) 
     1513        Me.LabelProxyPassword.Name = "LabelProxyPassword" 
     1514        Me.LabelProxyPassword.Size = New System.Drawing.Size(69, 12) 
     1515        Me.LabelProxyPassword.TabIndex = 9 
     1516        Me.LabelProxyPassword.Text = "パスワード(&W)" 
     1517        ' 
     1518        'TextProxyPassword 
     1519        ' 
     1520        Me.TextProxyPassword.Location = New System.Drawing.Point(274, 103) 
     1521        Me.TextProxyPassword.Name = "TextProxyPassword" 
     1522        Me.TextProxyPassword.Size = New System.Drawing.Size(68, 19) 
     1523        Me.TextProxyPassword.TabIndex = 10 
     1524        Me.TextProxyPassword.UseSystemPasswordChar = True 
     1525        ' 
     1526        'Label55 
     1527        ' 
     1528        Me.Label55.AutoSize = True 
     1529        Me.Label55.ForeColor = System.Drawing.SystemColors.ActiveCaption 
     1530        Me.Label55.Location = New System.Drawing.Point(28, 134) 
     1531        Me.Label55.Name = "Label55" 
     1532        Me.Label55.Size = New System.Drawing.Size(314, 12) 
     1533        Me.Label55.TabIndex = 11 
     1534        Me.Label55.Text = "※認証が不要な場合は、ユーザ名とパスワードは空にしてください。" 
    13791535        ' 
    13801536        'Setting 
     
    14051561        Me.TabPage3.PerformLayout() 
    14061562        Me.TabPage4.ResumeLayout(False) 
     1563        Me.TabPage5.ResumeLayout(False) 
     1564        Me.GroupBox2.ResumeLayout(False) 
     1565        Me.GroupBox2.PerformLayout() 
    14071566        Me.ResumeLayout(False) 
    14081567 
     
    15271686    Friend WithEvents CheckTinyURL As System.Windows.Forms.CheckBox 
    15281687    Friend WithEvents Label50 As System.Windows.Forms.Label 
     1688    Friend WithEvents TabPage5 As System.Windows.Forms.TabPage 
     1689    Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox 
     1690    Friend WithEvents RadioProxySpecified As System.Windows.Forms.RadioButton 
     1691    Friend WithEvents RadioProxyIE As System.Windows.Forms.RadioButton 
     1692    Friend WithEvents RadioProxyNone As System.Windows.Forms.RadioButton 
     1693    Friend WithEvents TextProxyPort As System.Windows.Forms.TextBox 
     1694    Friend WithEvents LabelProxyPort As System.Windows.Forms.Label 
     1695    Friend WithEvents TextProxyAddress As System.Windows.Forms.TextBox 
     1696    Friend WithEvents LabelProxyAddress As System.Windows.Forms.Label 
     1697    Friend WithEvents TextProxyPassword As System.Windows.Forms.TextBox 
     1698    Friend WithEvents LabelProxyPassword As System.Windows.Forms.Label 
     1699    Friend WithEvents TextProxyUser As System.Windows.Forms.TextBox 
     1700    Friend WithEvents LabelProxyUser As System.Windows.Forms.Label 
     1701    Friend WithEvents Label55 As System.Windows.Forms.Label 
    15291702    Friend WithEvents MaxPost As System.Windows.Forms.TextBox 
    15301703    Friend WithEvents Label52 As System.Windows.Forms.Label 
  • lang/vb2005/Tween/Tween/Setting.vb

    r21368 r21380  
    4343    Private _MyCloseToExit As Boolean 
    4444    Private _MyTinyUrlResolve As Boolean 
     45    Private _MyProxyType As ProxyTypeEnum 
     46    Private _MyProxyAddress As String 
     47    Private _MyProxyPort As Integer 
     48    Private _MyProxyUser As String 
     49    Private _MyProxyPassword As String 
    4550    Private _MyMaxPostNum As Integer 
    4651 
     
    176181            _MySortOrderLock = CheckSortOrderLock.Checked 
    177182            _MyTinyUrlResolve = CheckTinyURL.Checked 
     183            If RadioProxyNone.Checked Then 
     184                _MyProxyType = ProxyTypeEnum.None 
     185            ElseIf RadioProxyIE.Checked Then 
     186                _MyProxyType = ProxyTypeEnum.IE 
     187            Else 
     188                _MyProxyType = ProxyTypeEnum.Specified 
     189            End If 
     190            _MyProxyAddress = TextProxyAddress.Text.Trim() 
     191            _MyProxyPort = Integer.Parse(TextProxyPort.Text.Trim()) 
     192            _MyProxyUser = TextProxyUser.Text.Trim() 
     193            _MyProxyPassword = TextProxyPassword.Text.Trim() 
    178194 
    179195            'TweenMain.SetMainWindowTitle() 
     
    280296        CheckSortOrderLock.Checked = _MySortOrderLock 
    281297        CheckTinyURL.Checked = _MyTinyUrlResolve 
     298        Select Case _MyProxyType 
     299            Case ProxyTypeEnum.None 
     300                RadioProxyNone.Checked = True 
     301            Case ProxyTypeEnum.IE 
     302                RadioProxyIE.Checked = True 
     303            Case Else 
     304                RadioProxySpecified.Checked = True 
     305        End Select 
     306        Dim chk As Boolean = RadioProxySpecified.Checked 
     307        LabelProxyAddress.Enabled = chk 
     308        TextProxyAddress.Enabled = chk 
     309        LabelProxyPort.Enabled = chk 
     310        TextProxyPort.Enabled = chk 
     311        LabelProxyUser.Enabled = chk 
     312        TextProxyUser.Enabled = chk 
     313        LabelProxyPassword.Enabled = chk 
     314        TextProxyPassword.Enabled = chk 
     315 
     316        TextProxyAddress.Text = _MyProxyAddress 
     317        TextProxyPort.Text = _MyProxyPort.ToString 
     318        TextProxyUser.Text = _MyProxyUser 
     319        TextProxyPassword.Text = _MyProxyPassword 
    282320 
    283321        'TweenMain.SetMainWindowTitle() 
     
    926964    End Property 
    927965 
     966    Public Property ProxyType() As ProxyTypeEnum 
     967        Get 
     968            Return _MyProxyType 
     969        End Get 
     970        Set(ByVal value As ProxyTypeEnum) 
     971            _MyProxyType = value 
     972        End Set 
     973    End Property 
     974 
     975    Public Property ProxyAddress() As String 
     976        Get 
     977            Return _MyProxyAddress 
     978        End Get 
     979        Set(ByVal value As String) 
     980            _MyProxyAddress = value 
     981        End Set 
     982    End Property 
     983 
     984    Public Property ProxyPort() As Integer 
     985        Get 
     986            Return _MyProxyPort 
     987        End Get 
     988        Set(ByVal value As Integer) 
     989            _MyProxyPort = value 
     990        End Set 
     991    End Property 
     992 
     993    Public Property ProxyUser() As String 
     994        Get 
     995            Return _MyProxyUser 
     996        End Get 
     997        Set(ByVal value As String) 
     998            _MyProxyUser = value 
     999        End Set 
     1000    End Property 
     1001 
     1002    Public Property ProxyPassword() As String 
     1003        Get 
     1004            Return _MyProxyPassword 
     1005        End Get 
     1006        Set(ByVal value As String) 
     1007            _MyProxyPassword = value 
     1008        End Set 
     1009    End Property 
     1010 
    9281011    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 
    9291012        Dim filedlg As New OpenFileDialog() 
     
    9371020            BrowserPathText.Text = filedlg.FileName 
    9381021 
     1022        End If 
     1023    End Sub 
     1024 
     1025    Private Sub RadioProxySpecified_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioProxySpecified.CheckedChanged 
     1026        Dim chk As Boolean = RadioProxySpecified.Checked 
     1027        LabelProxyAddress.Enabled = chk 
     1028        TextProxyAddress.Enabled = chk 
     1029        LabelProxyPort.Enabled = chk 
     1030        TextProxyPort.Enabled = chk 
     1031        LabelProxyUser.Enabled = chk 
     1032        TextProxyUser.Enabled = chk 
     1033        LabelProxyPassword.Enabled = chk 
     1034        TextProxyPassword.Enabled = chk 
     1035    End Sub 
     1036 
     1037    Private Sub TextProxyPort_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextProxyPort.Validating 
     1038        Dim port As Integer 
     1039        If TextProxyPort.Text.Trim() = "" Then TextProxyPort.Text = "0" 
     1040        If Integer.TryParse(TextProxyPort.Text.Trim(), port) = False Then 
     1041            MessageBox.Show("�|�[�g�ԍ��ɂ͐����l��肵�Ă��������B") 
     1042            e.Cancel = True 
     1043            Exit Sub 
     1044        End If 
     1045        If port < 0 Or port > 65535 Then 
     1046            MessageBox.Show("�|�[�g�ԍ��ɂ��`65535��肵�Ă��������B") 
     1047            e.Cancel = True 
     1048            Exit Sub 
    9391049        End If 
    9401050    End Sub 
  • lang/vb2005/Tween/Tween/TwConfig.vb

    r21368 r21380  
    14681468        Set(ByVal value As Boolean) 
    14691469            Me("tinyurlresolve") = value 
     1470        End Set 
     1471    End Property 
     1472 
     1473    <ConfigurationProperty("proxytype", DefaultValue:=ProxyTypeEnum.IE)> _ 
     1474    Public Property ProxyType() As ProxyTypeEnum 
     1475        Get 
     1476            Return Me("proxytype") 
     1477        End Get 
     1478        Set(ByVal value As ProxyTypeEnum) 
     1479            Me("proxytype") = value 
     1480        End Set 
     1481    End Property 
     1482 
     1483    <ConfigurationProperty("proxyaddress", DefaultValue:="127.0.0.1")> _ 
     1484    Public Property ProxyAddress() As String 
     1485        Get 
     1486            Return Me("proxyaddress") 
     1487        End Get 
     1488        Set(ByVal value As String) 
     1489            Me("proxyaddress") = value 
     1490        End Set 
     1491    End Property 
     1492 
     1493    <ConfigurationProperty("proxyport", DefaultValue:=80)> _ 
     1494    Public Property ProxyPort() As Integer 
     1495        Get 
     1496            Return Me("proxyport") 
     1497        End Get 
     1498        Set(ByVal value As Integer) 
     1499            Me("proxyport") = value 
     1500        End Set 
     1501    End Property 
     1502 
     1503    <ConfigurationProperty("proxyuser", DefaultValue:="")> _ 
     1504    Public Property ProxyUser() As String 
     1505        Get 
     1506            Return Me("proxyuser") 
     1507        End Get 
     1508        Set(ByVal value As String) 
     1509            Me("proxyuser") = value 
     1510        End Set 
     1511    End Property 
     1512 
     1513    <ConfigurationProperty("proxypassword", DefaultValue:="")> _ 
     1514    Public Property ProxyPassword() As String 
     1515        Get 
     1516            Dim pwd As String = "" 
     1517            If CStr(Me("proxypassword")).Length > 0 Then 
     1518                Try 
     1519                    pwd = DecryptString(CStr(Me("proxypassword"))) 
     1520                Catch ex As Exception 
     1521                    pwd = "" 
     1522                End Try 
     1523            End If 
     1524            Return pwd 
     1525        End Get 
     1526        Set(ByVal value As String) 
     1527            Dim pwd As String = value.Trim() 
     1528            If pwd.Length > 0 Then 
     1529                Try 
     1530                    Me("proxypassword") = EncryptString(value) 
     1531                Catch ex As Exception 
     1532                    Me("proxypassword") = "" 
     1533                End Try 
     1534            Else 
     1535                Me("proxypassword") = "" 
     1536            End If 
    14701537        End Set 
    14711538    End Property 
  • lang/vb2005/Tween/Tween/Tween.vb

    r21368 r21380  
    7676        FavAdd                  'Fav追加 
    7777        FavRemove               'Fav削除 
     78        CreateNewSocket         'Socket再作成 
    7879    End Enum 
    7980 
     
    103104 
    104105    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
    105         'バージョンチェック(引数:起動時チェックの場合はTrue・・・チェック結果のメッセージを表示しない) 
    106         Call CheckNewVersion(True) 
    107  
    108106        'OSバージョン判定。ビジュアルスタイルのRenderMode切り替え(メニュー関連の描画方法) 
    109107        If System.Environment.OSVersion.Version.Major = 4 Or _ 
     
    313311        SettingDialog.SortOrderLock = _section.SortOrderLock 
    314312        SettingDialog.TinyUrlResolve = _section.TinyURLResolve 
     313        SettingDialog.ProxyType = _section.ProxyType 
     314        SettingDialog.ProxyAddress = _section.ProxyAddress 
     315        SettingDialog.ProxyPort = _section.ProxyPort 
     316        SettingDialog.ProxyUser = _section.ProxyUser 
     317        SettingDialog.ProxyPassword = _section.ProxyPassword 
    315318 
    316319        'ユーザー名、パスワードが未設定なら設定画面を表示(初回起動時など) 
     
    345348        End If 
    346349 
     350        'バージョンチェック(引数:起動時チェックの場合はTrue・・・チェック結果のメッセージを表示しない) 
     351        Call CheckNewVersion(True) 
     352 
    347353        'ウィンドウ設定 
    348354        Me.WindowState = FormWindowState.Normal     '通常状態 
     
    379385 
    380386        'Twitter用通信クラス初期化 
    381         clsTw = New Twitter(_username, _password) 
    382         clsTwPost = New Twitter(_username, _password) 
     387        clsTw = New Twitter(_username, _password, SettingDialog.ProxyType, SettingDialog.ProxyAddress, SettingDialog.ProxyPort, SettingDialog.ProxyUser, SettingDialog.ProxyPassword) 
     388        clsTwPost = New Twitter(_username, _password, SettingDialog.ProxyType, SettingDialog.ProxyAddress, SettingDialog.ProxyPort, SettingDialog.ProxyUser, SettingDialog.ProxyPassword) 
    383389        Call clsTw.GetWedata() 
    384390        clsTw.NextThreshold = SettingDialog.NextPageThreshold   '次頁取得閾値 
     
    606612    Private Sub Network_NetworkAvailabilityChanged(ByVal sender As Object, ByVal e As Devices.NetworkAvailableEventArgs) 
    607613        If e.IsNetworkAvailable Then 
    608             Call clsTw.CreateNewSocket() 
    609             Call clsTwPost.CreateNewSocket() 
     614            Dim args As New GetWorkerArg 
     615            args.type = WORKERTYPE.CreateNewSocket 
     616            Do While GetTimelineWorker.IsBusy 
     617                Threading.Thread.Sleep(100) 
     618                Application.DoEvents() 
     619            Loop 
     620            GetTimelineWorker.RunWorkerAsync(args) 
     621            Do While PostWorker.IsBusy 
     622                Threading.Thread.Sleep(100) 
     623                Application.DoEvents() 
     624            Loop 
     625            PostWorker.RunWorkerAsync(args) 
    610626            PostButton.Enabled = True 
    611627            'ReplyStripMenuItem.Enabled = True 
     
    626642                _refreshIconCnt = 0 
    627643                TimerRefreshIcon.Enabled = True 
    628                 Dim args As New GetWorkerArg 
    629644                args.page = 1 
    630645                args.endPage = 1 
     
    14661481                    Case WORKERTYPE.FavRemove 
    14671482                        ret = clsTw.PostFavRemove(args.ids(args.page)) 
     1483                    Case WORKERTYPE.CreateNewSocket 
     1484                        Call clsTw.CreateNewSocket() 
    14681485                End Select 
    14691486                If args.type = WORKERTYPE.PostMessage Then 
     
    15831600 
    15841601        Select Case rslt.type 
     1602            Case WORKERTYPE.CreateNewSocket 
     1603                Exit Sub 
    15851604            Case WORKERTYPE.Timeline 
    15861605                StatusLabel.Text = "Recent更新完了" 
     
    30233042            clsTw.HubServer = SettingDialog.HubServer 
    30243043            clsTwPost.HubServer = SettingDialog.HubServer 
     3044            clsTw.ProxyType = SettingDialog.ProxyType 
     3045            clsTw.ProxyAddress = SettingDialog.ProxyAddress 
     3046            clsTw.ProxyPort = SettingDialog.ProxyPort 
     3047            clsTw.ProxyUser = SettingDialog.ProxyUser 
     3048            clsTw.ProxyPassword = SettingDialog.ProxyPassword 
     3049            Dim args As New GetWorkerArg 
     3050            args.type = WORKERTYPE.CreateNewSocket 
     3051            Do While GetTimelineWorker.IsBusy 
     3052                Threading.Thread.Sleep(100) 
     3053                Application.DoEvents() 
     3054            Loop 
     3055            GetTimelineWorker.RunWorkerAsync(args) 
     3056            clsTwPost.ProxyType = SettingDialog.ProxyType 
     3057            clsTwPost.ProxyAddress = SettingDialog.ProxyAddress 
     3058            clsTwPost.ProxyPort = SettingDialog.ProxyPort 
     3059            clsTwPost.ProxyUser = SettingDialog.ProxyUser 
     3060            clsTwPost.ProxyPassword = SettingDialog.ProxyPassword 
     3061            Do While PostWorker.IsBusy 
     3062                Threading.Thread.Sleep(100) 
     3063                Application.DoEvents() 
     3064            Loop 
     3065            PostWorker.RunWorkerAsync(args) 
    30253066            'If isz <> SettingDialog.IconSz Then 
    30263067            '    Select Case SettingDialog.IconSz 
     
    43624403 
    43634404    Private Sub CheckNewVersion(Optional ByVal startup As Boolean = False) 
    4364         Dim _mySock As New MySocket("Shift_JIS") 
     4405        Dim _mySock As New MySocket("Shift_JIS", "", "", _ 
     4406                                SettingDialog.ProxyType, _ 
     4407                                SettingDialog.ProxyAddress, _ 
     4408                                SettingDialog.ProxyPort, _ 
     4409                                SettingDialog.ProxyUser, _ 
     4410                                SettingDialog.ProxyPassword) 
    43654411        Dim retMsg As String 
    43664412        Dim resStatus As String = "" 
     
    57745820        Dim args As GetWorkerArg = DirectCast(e.Argument, GetWorkerArg) 
    57755821        Try 
    5776             '            For i As Integer = 0 To 2 
    5777             CheckReplyTo(args.status) 
    5778  
    5779             ret = clsTwPost.PostStatus(args.status, _reply_to_id) 
    5780  
    5781             _reply_to_id = 0 
    5782             _reply_to_name = Nothing 
     5822            If args.type = WORKERTYPE.CreateNewSocket Then 
     5823                Call clsTwPost.CreateNewSocket() 
     5824            Else 
     5825                '            For i As Integer = 0 To 2 
     5826                CheckReplyTo(args.status) 
     5827 
     5828                ret = clsTwPost.PostStatus(args.status, _reply_to_id) 
     5829 
     5830                _reply_to_id = 0 
     5831                _reply_to_name = Nothing 
     5832            End If 
    57835833            rslt.retMsg = ret 
    57845834            rslt.TLine = Nothing 
     
    58475897 
    58485898        Select Case rslt.type 
     5899            Case WORKERTYPE.CreateNewSocket 
     5900                Exit Sub 
    58495901            Case WORKERTYPE.PostMessage 
    58505902                StatusText.Enabled = True 
  • lang/vb2005/Tween/Tween/Twitter.vb

    r21318 r21380  
    1111    Private _uid As String 
    1212    Private _pwd As String 
     13    Private _proxyType As ProxyTypeEnum 
     14    Private _proxyAddress As String 
     15    Private _proxyPort As Integer 
     16    Private _proxyUser As String 
     17    Private _proxyPassword As String 
     18 
    1319    'Private _lastId As String 
    1420    'Private _lastName As String 
     
    164170    End Enum 
    165171 
    166     Public Sub New(Optional ByVal Username As String = "", Optional ByVal Password As String = "") 
     172    Public Sub New(ByVal Username As String, _ 
     173                ByVal Password As String, _ 
     174                ByVal ProxyType As ProxyTypeEnum, _ 
     175                ByVal ProxyAddress As String, _ 
     176                ByVal ProxyPort As Integer, _ 
     177                ByVal ProxyUser As String, _ 
     178                ByVal ProxyPassword As String) 
    167179        'Proxyを考慮したSocketの宛先設定 
    168180        'TIconSmallList = New ImageList 
    169181        'TIconSmallList.ImageSize = New Size(_iconSz, _iconSz) 
    170182        'TIconSmallList.ColorDepth = ColorDepth.Depth32Bit 
    171         _mySock = New MySocket("UTF-8", Username, Password) 
     183        _mySock = New MySocket("UTF-8", Username, Password, ProxyType, ProxyAddress, ProxyPort, ProxyUser, ProxyPassword) 
    172184        _uid = Username 
    173185        _pwd = Password 
    174186        follower.Add(_uid) 
     187        _proxyType = ProxyType 
     188        _proxyAddress = ProxyAddress 
     189        _proxyPort = ProxyPort 
     190        _proxyUser = ProxyUser 
     191        _proxyPassword = ProxyPassword 
    175192    End Sub 
    176193 
     
    15791596    End Property 
    15801597 
     1598    Public WriteOnly Property ProxyType() As ProxyTypeEnum 
     1599        Set(ByVal value As ProxyTypeEnum) 
     1600            _proxyType = value 
     1601        End Set 
     1602    End Property 
     1603 
     1604    Public WriteOnly Property ProxyAddress() As String 
     1605        Set(ByVal value As String) 
     1606            _proxyAddress = value 
     1607        End Set 
     1608    End Property 
     1609 
     1610    Public WriteOnly Property ProxyPort() As Integer 
     1611        Set(ByVal value As Integer) 
     1612            _proxyPort = value 
     1613        End Set 
     1614    End Property 
     1615 
     1616    Public WriteOnly Property ProxyUser() As String 
     1617        Set(ByVal value As String) 
     1618            _proxyUser = value 
     1619        End Set 
     1620    End Property 
     1621 
     1622    Public WriteOnly Property ProxyPassword() As String 
     1623        Set(ByVal value As String) 
     1624            _proxyPassword = value 
     1625        End Set 
     1626    End Property 
     1627 
    15811628    Public Sub CreateNewSocket() 
    15821629        _mySock = Nothing 
    1583         _mySock = New MySocket("UTF-8", Username, Password) 
     1630        _mySock = New MySocket("UTF-8", Username, Password, _proxyType, _proxyAddress, _proxyPort, _proxyUser, _proxyPassword) 
    15841631        _signed = False 
    15851632    End Sub