Changeset 34799 for lang

Show
Ignore:
Timestamp:
08/06/09 18:50:46 (4 years ago)
Author:
kiri_feather
Message:

OAuth実装途中

Location:
lang/vb2005/Tween/trunk/Tween
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/vb2005/Tween/trunk/Tween/Connection/HttpConnection.vb

    r34737 r34799  
    11Imports System.Net 
    22 
     3'''<summary> 
     4'''HttpWebRequest,HttpWebResponse��p�������I�ȒʐM�@�\�������'''</summary> 
     5'''<remarks> 
     6'''�v���L�V���Ȃǂ�肷�邽�߁A�g�p�O�ɐÓI���\�b�hInitializeConnection��яo�����ƁB 
     7'''�ʐM�����ĕK�v�ɂȂ�TP�w�b�_�̕t��Ȃǂ́A�h���N���X��etContent���\�b�h��[�o�[���C�h���čs���B 
     8'''</remarks> 
    39Public Class HttpConnection 
     10    '''<summary> 
     11    '''�v���L�V 
     12    '''</summary> 
    413    Private Shared _proxy As System.Net.WebProxy = Nothing 
     14 
     15    '''<summary> 
     16    '''���[�U�[���I����v���L�V�̕�    '''</summary> 
    517    Private Shared _proxyType As ProxyType = ProxyType.IE 
     18 
     19    '''<summary> 
     20    '''CreateRequest���\�b�h�Ŏw�肪�ȗ����ꂽ�ۂɎg�p�����M�^�C���A�E�g���ԁims�j 
     21    '''</summary> 
    622    Private Shared _defaultTimeOut As Integer = 20000 
     23 
     24    '''<summary> 
     25    '''�N�b�L�[�ۑ��p�R���e�i 
     26    '''</summary> 
    727    Private Shared _cookieContainer As New CookieContainer 
    828 
     29    '''<summary> 
     30    '''HTTP�ʐM�̃��\�b�h 
     31    '''</summary> 
     32    '''<remarks> 
     33    '''���̃��\�b�h�iHEAD,PUT,CONNECT�Ȃǁj���K�v�ȏꍇ�͒lj���邱�� 
     34    '''</remarks> 
    935    Protected Enum RequestMethod 
    1036        ReqGet 
     
    1238    End Enum 
    1339 
     40    '''<summary> 
     41    '''HTTP�ʐM���ăR���e���c���������������e���c�j 
     42    '''</summary> 
     43    '''<remarks> 
     44    '''�ʐM�^�C���A�E�g�Ȃ�ebException����h�����Ă��Ȃ����߁A�Ăяo�����ŏ������K�v�B 
     45    '''�^�C���A�E�g�w�����X�|���X�w�b�_�擾�͏ȗ����Ă��� 
     46    '''���X�|���X�̃{�f�B�X�g���[���𕶎���ϊ�����ontent���i�[���Ė߂��B�����G���R�[�h�͖��w��    '''</remarks> 
     47    '''<param name="method">HTTP�̃��\�b�h</param> 
     48    '''<param name="url">URL</param> 
     49    '''<param name="param">key=value�ɓW�J�����A�N�G���iGET���j�E�{�f�B�iPOST���j�ɕt��������M��</param> 
     50    '''<param name="content">HTTP���X�|���X�̃{�f�B���f�[�^�ԋp�p�B�Ăяo�����ŏ����K�v</param> 
     51    '''<returns>�ʐM���ʂ�ttpStatusCode</returns> 
    1452    Protected Overridable Function GetContent(ByVal method As RequestMethod, _ 
    1553            ByVal url As System.Uri, _ 
     
    3068    End Function 
    3169 
     70    '''<summary> 
     71    '''HTTP�ʐM���ăR���e���c��������摜�R���e���c�j 
     72    '''</summary> 
     73    '''<remarks> 
     74    '''�ʐM�^�C���A�E�g�Ȃ�ebException����h�����Ă��Ȃ����߁A�Ăяo�����ŏ������K�v�B 
     75    '''�^�C���A�E�g�w�����X�|���X�w�b�_�擾�͏ȗ����Ă��� 
     76    '''���X�|���X�̃{�f�B�X�g���[����map�ɕϊ�����ontent���i�[���Ė߂��B 
     77    '''</remarks> 
     78    '''<param name="method">HTTP�̃��\�b�h</param> 
     79    '''<param name="url">URL</param> 
     80    '''<param name="param">key=value�ɓW�J�����A�N�G���iGET���j�E�{�f�B�iPOST���j�ɕt��������M��</param> 
     81    '''<param name="content">HTTP���X�|���X�̃{�f�B���f�[�^�ԋp�p�B�Ăяo�����ŏ����K�v</param> 
     82    '''<returns>�ʐM���ʂ�ttpStatusCode</returns> 
    3283    Protected Overridable Function GetContent(ByVal method As RequestMethod, _ 
    3384            ByVal url As System.Uri, _ 
     
    4899                                            ByVal url As System.Uri, _ 
    49100                                            ByVal param As System.Collections.Generic.SortedList(Of String, String)) As HttpWebRequest 
     101        Return CreateRequest(method, url, _defaultTimeOut, param) 
     102    End Function 
     103 
     104    Protected Shared Function CreateRequest(ByVal method As RequestMethod, _ 
     105                                            ByVal url As System.Uri, _ 
     106                                            ByVal timeout As Integer, _ 
     107                                            ByVal param As System.Collections.Generic.SortedList(Of String, String)) As HttpWebRequest 
    50108 
    51109        Dim ub As New System.UriBuilder(url.AbsoluteUri) 
     
    55113        Dim webReq As HttpWebRequest = DirectCast(WebRequest.Create(ub.Uri), HttpWebRequest) 
    56114 
    57         webReq.Timeout = _defaultTimeOut 
     115        webReq.Timeout = timeout 
    58116        If _proxyType <> ProxyType.IE Then webReq.Proxy = _proxy 
    59117 
  • lang/vb2005/Tween/trunk/Tween/Tween.vbproj

    r34737 r34799  
    8282    <Compile Include="ApplicationEvents.vb" /> 
    8383    <Compile Include="Connection\HttpConnection.vb" /> 
     84    <Compile Include="Connection\HttpConnectionOAuth.vb" /> 
    8485    <Compile Include="DetailsListView.vb"> 
    8586    </Compile>