【问题标题】:How can I use FitBit API for website development?如何使用 FitBit API 进行网站开发?
【发布时间】:2012-07-13 06:28:27
【问题描述】:

我正在尝试在网站开发中使用 FitBit API,我想从头开始制作一个网站,但我无法做到。

我已经按照here 中描述的步骤进行操作,并根据here 中描述的想法在 Visual Studio 中创建了一个 VB.NET 网站。我已经下载了 OauthNET-Release 库,在我的项目中引用了 DLL,我的 web.config 如下所示:

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<!--<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </authentication>

    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>-->

<configuration>
  <configSections>
    <section name="foo" type="bar"/>
    <!-- lines omitted -->
  </configSections>
  <oauth.net.components>
    <!-- Components -->
    <components>
      <!-- Signing provider for HMAC-SHA1 -->
      <component service="OAuth.Net.Common.ISigningProvider, OAuth.Net.Common" lifestyle="thread"/>
      <!-- Nonce provider -->
      <component service="OAuth.Net.Common.INonceProvider, OAuth.Net.Common"/>
      <!-- State store -->
      <component service="OAuth.Net.Consumer.IRequestStateStore, OAuth.Net.Consumer"/>
    </components>
  </oauth.net.components>
  <!-- lines omitted -->
</configuration>

我尝试建立网站,但没有成功,我收到了这条消息:

Error   11  Unrecognized configuration section oauth.net.components.

我的问题是:我应该怎么做才能完成这项工作?先感谢您。

【问题讨论】:

    标签: asp.net oauth fitbit


    【解决方案1】:

    您是否将部分注册添加到 webconfig 的&lt;configSections&gt;?像这样:

    <configSections>
      <section name="oauth.net.components" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
      <!-- other stuff -->
    </configSections>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-01
      • 2015-10-16
      • 1970-01-01
      • 2022-01-23
      相关资源
      最近更新 更多