├── .gitattributes ├── .gitignore ├── .nuget ├── NuGet.Config ├── NuGet.exe ├── NuGet.targets └── Package.nuspec ├── ConsoleDemo ├── ConsoleDemo.csproj ├── MrJSON-Production.png ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── QQConnectTest.cs ├── SinaWeiboTest.cs ├── app.config └── packages.config ├── LICENSE ├── MvcDemo ├── App_Start │ ├── FilterConfig.cs │ └── RouteConfig.cs ├── Content │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── font-awesome.css │ ├── font-awesome.min.css │ └── site.css ├── Controllers │ ├── DemoController.cs │ └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── Icon.png ├── MvcDemo.csproj ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── _references.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-2.1.4.intellisense.js │ ├── jquery-2.1.4.js │ ├── jquery-2.1.4.min.js │ ├── jquery.min.map │ ├── jquery.upload.js │ └── npm.js ├── Views │ ├── Demo │ │ └── Index.cshtml │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── Web.config │ └── _viewstart.cshtml ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── images │ ├── Logo.png │ ├── qrcode.jpg │ └── step1.png └── packages.config ├── NetDimension.OpenAuth.Sina ├── NetDimension.OpenAuth.Sina.csproj ├── NetDimension.OpenAuth.Sina.nuspec ├── Properties │ └── AssemblyInfo.cs ├── SinaWeiboClient.cs ├── app.config └── packages.config ├── NetDimension.OpenAuth.Tencent ├── NetDimension.OpenAuth.Tencent.csproj ├── Properties │ └── AssemblyInfo.cs ├── QQConnectClient.cs ├── app.config └── packages.config ├── NetDimension.OpenAuth.Winform ├── AuthenticationForm.Designer.cs ├── AuthenticationForm.cs ├── AuthenticationForm.resx ├── NetDimension.OpenAuth.Winform.csproj ├── OpenAuthenticationClientExtensions.cs ├── Properties │ └── AssemblyInfo.cs └── app.config ├── NetDimension.OpenAuth ├── MemoryFileContent.cs ├── NetDimension.OpenAuth.csproj ├── OpenAuthenticationClientBase.cs ├── Properties │ └── AssemblyInfo.cs ├── app.config └── packages.config ├── README.md ├── WeiboSDK.sln └── WinformDemo ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources ├── body_bg.jpg ├── email.png ├── icon_app.ico ├── icon_form.ico ├── image_add.png └── paperfly.png ├── WinformDemo.csproj ├── app.config └── packages.config /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | *.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetDimension/WeiboSDK/9cdb3db53c407f9a8fe2252f720fe5557ba8d7a2/.nuget/NuGet.exe -------------------------------------------------------------------------------- /.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | 6 | 7 | false 8 | 9 | 10 | false 11 | 12 | 13 | true 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 31 | 32 | 33 | 34 | 35 | $(SolutionDir).nuget 36 | 37 | 38 | 39 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config 40 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config 41 | 42 | 43 | 44 | $(MSBuildProjectDirectory)\packages.config 45 | $(PackagesProjectConfig) 46 | 47 | 48 | 49 | 50 | $(NuGetToolsPath)\NuGet.exe 51 | @(PackageSource) 52 | 53 | "$(NuGetExePath)" 54 | mono --runtime=v4.0.30319 "$(NuGetExePath)" 55 | 56 | $(TargetDir.Trim('\\')) 57 | 58 | -RequireConsent 59 | -NonInteractive 60 | 61 | "$(SolutionDir) " 62 | "$(SolutionDir)" 63 | 64 | 65 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) 66 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols 67 | 68 | 69 | 70 | RestorePackages; 71 | $(BuildDependsOn); 72 | 73 | 74 | 75 | 76 | $(BuildDependsOn); 77 | BuildPackage; 78 | 79 | 80 | 81 | 82 | 83 | 84 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 99 | 100 | 103 | 104 | 105 | 106 | 108 | 109 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /.nuget/Package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Package 5 | 1.0.0 6 | Anderson 7 | Anderson 8 | http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE 9 | http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE 10 | http://ICON_URL_HERE_OR_DELETE_THIS_LINE 11 | false 12 | Package description 13 | Summary of changes made in this release of the package. 14 | Copyright 2016 15 | Tag1 Tag2 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ConsoleDemo/ConsoleDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DC434F36-8A91-48A7-BF76-BE72FFDF0C71} 8 | Exe 9 | Properties 10 | ConsoleDemo 11 | ConsoleDemo 12 | v4.0 13 | 512 14 | SAK 15 | SAK 16 | SAK 17 | SAK 18 | ..\ 19 | true 20 | 21 | 22 | AnyCPU 23 | true 24 | full 25 | false 26 | bin\Debug\ 27 | DEBUG;TRACE 28 | prompt 29 | 4 30 | 31 | 32 | AnyCPU 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | 42 | False 43 | ..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll 44 | 45 | 46 | 47 | 48 | ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll 49 | 50 | 51 | False 52 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.dll 53 | 54 | 55 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Extensions.dll 56 | 57 | 58 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Primitives.dll 59 | 60 | 61 | False 62 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.WebRequest.dll 63 | 64 | 65 | ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll 66 | 67 | 68 | ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | {76fc909d-bda2-4fce-9b9f-b503a13df44f} 86 | NetDimension.OpenAuth.Sina 87 | 88 | 89 | {df5550c5-b4e3-4697-87b7-f6182dbfbc6f} 90 | NetDimension.OpenAuth.Tencent 91 | 92 | 93 | {0d1f893b-af94-4e52-b972-a5d40e1db670} 94 | NetDimension.OpenAuth.Winform 95 | 96 | 97 | {38b68338-7fc0-4ab7-b8a7-674e0bcbf899} 98 | NetDimension.OpenAuth 99 | 100 | 101 | 102 | 103 | Always 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 130 | -------------------------------------------------------------------------------- /ConsoleDemo/MrJSON-Production.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetDimension/WeiboSDK/9cdb3db53c407f9a8fe2252f720fe5557ba8d7a2/ConsoleDemo/MrJSON-Production.png -------------------------------------------------------------------------------- /ConsoleDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using NetDimension.OpenAuth; 2 | using NetDimension.OpenAuth.Sina; 3 | using NetDimension.OpenAuth.Tencent; 4 | using NetDimension.OpenAuth.Winform; 5 | using Newtonsoft.Json.Linq; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Diagnostics; 9 | using System.Linq; 10 | using System.Text; 11 | 12 | namespace ConsoleDemo 13 | { 14 | 15 | class Program 16 | { 17 | [STAThread] 18 | static void Main(string[] args) 19 | { 20 | 21 | 22 | var act = new Func(() => 23 | { 24 | return "test"; 25 | }); 26 | 27 | console.key("WeiboSDK_V3 Console 示例"); 28 | console.key("版权所有 (C) NetDimension Studio 保留全部权利。"); 29 | var loop = true; 30 | while (loop) 31 | { 32 | console.tip("1. 新浪微博测试"); 33 | console.tip("2. 腾讯开发平台测试"); 34 | console.tip("3. 退出"); 35 | 36 | Console.Write("选择一个项目:"); 37 | 38 | 39 | 40 | 41 | var key = Console.ReadKey(); 42 | console.log(); 43 | 44 | switch (key.Key) 45 | { 46 | case ConsoleKey.D1: 47 | var sina = new SinaWeiboTest(); 48 | break; 49 | case ConsoleKey.D2: 50 | var tencent = new QQConnectTest(); 51 | break; 52 | case ConsoleKey.D3: 53 | loop = false; 54 | break; 55 | } 56 | 57 | //var sinaWeibo = new SinaWeiboTest(); 58 | 59 | } 60 | 61 | 62 | } 63 | 64 | 65 | 66 | 67 | 68 | 69 | } 70 | 71 | 72 | public static class console 73 | { 74 | public static void log() 75 | { 76 | Console.WriteLine(); 77 | 78 | } 79 | 80 | public static void log(string msg, params object[] args) 81 | { 82 | if (args.Length > 0) 83 | { 84 | Console.WriteLine(msg, args); 85 | } 86 | else 87 | { 88 | Console.WriteLine(msg); 89 | } 90 | 91 | } 92 | public static void warn(string msg, params object[] args) 93 | { 94 | Console.ForegroundColor = ConsoleColor.Magenta; 95 | log(msg, args); 96 | 97 | Console.ResetColor(); 98 | } 99 | 100 | public static void error(string msg, params object[] args) 101 | { 102 | Console.ForegroundColor = ConsoleColor.Red; 103 | log(msg, args); 104 | Console.ResetColor(); 105 | } 106 | 107 | public static void info(string msg, params object[] args) 108 | { 109 | Console.ForegroundColor = ConsoleColor.Yellow; 110 | log(msg, args); 111 | Console.ResetColor(); 112 | } 113 | 114 | public static void tip(string msg, params object[] args) 115 | { 116 | Console.ForegroundColor = ConsoleColor.Cyan; 117 | log(msg, args); 118 | Console.ResetColor(); 119 | } 120 | 121 | public static void attention(string msg, params object[] args) 122 | { 123 | Console.ForegroundColor = ConsoleColor.Green; 124 | log(msg, args); 125 | Console.ResetColor(); 126 | } 127 | 128 | public static void key(string msg, params object[] args) 129 | { 130 | Console.ForegroundColor = ConsoleColor.White; 131 | log(msg, args); 132 | Console.ResetColor(); 133 | } 134 | 135 | public static void data(string msg, params object[] args) 136 | { 137 | Console.ForegroundColor = ConsoleColor.DarkGray; 138 | log(msg, args); 139 | Console.ResetColor(); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /ConsoleDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ConsoleDemo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Net Dimension Studio")] 12 | [assembly: AssemblyProduct("ConsoleDemo")] 13 | [assembly: AssemblyCopyright("Copyright © Net Dimension Studio 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("37407768-7fbc-49cd-8eb3-4feb35401eb6")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ConsoleDemo/QQConnectTest.cs: -------------------------------------------------------------------------------- 1 | using NetDimension.OpenAuth.Tencent; 2 | using NetDimension.OpenAuth.Winform; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | namespace ConsoleDemo 10 | { 11 | class QQConnectTest 12 | { 13 | public QQConnectTest() 14 | { 15 | var openAuth = new QQConnectClient("101194847", "2904a4765f7d449918aceedc66600eec", "http://dev.ohtrip.cn"); 16 | var form = openAuth.GetAuthenticationForm(); 17 | 18 | 19 | 20 | 21 | if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) 22 | { 23 | console.info("用户授权成功!"); 24 | console.data("AccessToken={0}\tOpenId={1}", openAuth.AccessToken, openAuth.OpenId); 25 | StartTest(openAuth); 26 | } 27 | else 28 | { 29 | console.error("用户授权失败!"); 30 | } 31 | 32 | 33 | } 34 | 35 | private void StartTest(QQConnectClient openAuth) 36 | { 37 | 38 | console.attention("按任意键获取用户信息"); 39 | Console.ReadKey(true); 40 | GetUserInfo(openAuth); 41 | 42 | console.attention("按任意键发布一条图片微博"); 43 | Console.ReadKey(true); 44 | PostImageStatus(openAuth); 45 | 46 | console.attention("按任意键发布一条文字微博"); 47 | Console.ReadKey(true); 48 | PostStatus(openAuth); 49 | } 50 | 51 | private void GetUserInfo(QQConnectClient openAuth) 52 | { 53 | var response = openAuth.HttpGet("user/get_user_info"); 54 | 55 | if (response.IsSuccessStatusCode) 56 | { 57 | console.data(response.Content.ReadAsStringAsync().Result); 58 | } 59 | } 60 | 61 | private void PostStatus(QQConnectClient openAuth) 62 | { 63 | console.info("发布一条微博..."); 64 | 65 | 66 | var result = openAuth.HttpPost("t/add_t", new Dictionary 67 | { 68 | {"content", string.Format("发布自WeiboSDK_V3@{0:HH:mm:ss}", DateTime.Now)} 69 | }); 70 | 71 | 72 | if (result.IsSuccessStatusCode) 73 | { 74 | 75 | console.data(result.Content.ReadAsStringAsync().Result); 76 | console.info("发布成功!"); 77 | } 78 | } 79 | 80 | private void PostImageStatus(QQConnectClient openAuth) 81 | { 82 | console.info("发布一条图片微博..."); 83 | 84 | var imgPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"MrJSON-Production.png"); 85 | 86 | var buff = File.ReadAllBytes(imgPath); 87 | 88 | var result = openAuth.HttpPost("t/add_pic_t", new Dictionary { 89 | 90 | {"content" , string.Format("SDK TEST {0:HH:mm:ss}", DateTime.Now)}, 91 | {"pic" , buff} 92 | }); 93 | 94 | 95 | 96 | if (result.IsSuccessStatusCode) 97 | { 98 | 99 | console.data(result.Content.ReadAsStringAsync().Result); 100 | console.info("发布成功!"); 101 | } 102 | } 103 | 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /ConsoleDemo/SinaWeiboTest.cs: -------------------------------------------------------------------------------- 1 | using NetDimension.OpenAuth.Sina; 2 | using NetDimension.OpenAuth.Winform; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | namespace ConsoleDemo 10 | { 11 | class SinaWeiboTest 12 | { 13 | public SinaWeiboTest() 14 | { 15 | console.info("等待用户授权..."); 16 | 17 | 18 | 19 | var openAuth = new SinaWeiboClient("1402038860", "62e1ddd4f6bc33077c796d5129047ca2", "http://qcyn.sina.com.cn"); 20 | 21 | var form = openAuth.GetAuthenticationForm(); 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) 30 | { 31 | console.info("用户授权成功!"); 32 | console.data("AccessToken={0}", openAuth.AccessToken); 33 | 34 | 35 | StartTest(openAuth); 36 | 37 | } 38 | else 39 | { 40 | console.error("用户授权失败!"); 41 | } 42 | } 43 | 44 | private void StartTest(SinaWeiboClient openAuth) 45 | { 46 | console.attention("按任意键发布一条文字微博"); 47 | Console.ReadKey(true); 48 | PostStatus(openAuth); 49 | 50 | console.attention("按任意键发布一条图片微博"); 51 | Console.ReadKey(true); 52 | PostImageStatus(openAuth); 53 | 54 | console.attention("按任意键获取最新微博"); 55 | Console.ReadKey(true); 56 | GetFrindTimeline(openAuth); 57 | } 58 | 59 | private void GetFrindTimeline(SinaWeiboClient openAuth) 60 | { 61 | console.info("获取当前登录用户及其所关注用户的最新微博..."); 62 | 63 | 64 | var result = openAuth.HttpGet("statuses/friends_timeline.json", new Dictionary 65 | { 66 | {"count", 5}, 67 | {"page", 1}, 68 | {"base_app" , 0} 69 | }); 70 | console.attention("{0}", result); 71 | 72 | if (result.IsSuccessStatusCode) 73 | { 74 | 75 | console.data(result.Content.ReadAsStringAsync().Result); 76 | console.info("获取成功!"); 77 | } 78 | 79 | } 80 | 81 | private void PostImageStatus(SinaWeiboClient openAuth) 82 | { 83 | console.info("发布一条图片微博..."); 84 | 85 | var imgPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"MrJSON-Production.png"); 86 | var result = openAuth.HttpPost("statuses/upload.json", new Dictionary { 87 | 88 | {"status" , string.Format("发布自SinaWeiboSDK_V3@{0:HH:mm:ss}", DateTime.Now)}, 89 | {"pic" , new FileInfo(imgPath)} 90 | }); 91 | 92 | console.attention("{0}", result); 93 | 94 | 95 | if (result.IsSuccessStatusCode) 96 | { 97 | 98 | console.data(result.Content.ReadAsStringAsync().Result); 99 | console.info("发布成功!"); 100 | } 101 | } 102 | 103 | private void PostStatus(SinaWeiboClient openAuth) 104 | { 105 | console.info("发布一条微博..."); 106 | 107 | 108 | var result = openAuth.HttpPost("statuses/update.json", new Dictionary 109 | { 110 | {"status" , string.Format("发布自SinaWeiboSDK_V3@{0:HH:mm:ss}", DateTime.Now)} 111 | }); 112 | 113 | console.attention("{0}", result); 114 | if (result.IsSuccessStatusCode) 115 | { 116 | 117 | console.data(result.Content.ReadAsStringAsync().Result); 118 | console.info("发布成功!"); 119 | } 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ConsoleDemo/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ConsoleDemo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetDimension/WeiboSDK/9cdb3db53c407f9a8fe2252f720fe5557ba8d7a2/LICENSE -------------------------------------------------------------------------------- /MvcDemo/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace MvcDemo 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /MvcDemo/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MvcDemo 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /MvcDemo/Content/site.css: -------------------------------------------------------------------------------- 1 | footer 2 | { 3 | background-color:#4400D9; 4 | height:80px; 5 | padding:20px 0; 6 | color:#fff; 7 | margin:30px 0 0 0; 8 | } 9 | -------------------------------------------------------------------------------- /MvcDemo/Controllers/DemoController.cs: -------------------------------------------------------------------------------- 1 | using NetDimension.OpenAuth.Sina; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Configuration; 7 | using System.Drawing; 8 | using System.Drawing.Imaging; 9 | using System.IO; 10 | using System.Linq; 11 | using System.Web; 12 | using System.Web.Mvc; 13 | 14 | namespace MvcDemo.Controllers 15 | { 16 | public class DemoController : Controller 17 | { 18 | // 19 | // GET: /Demo/ 20 | 21 | public ActionResult Index() 22 | { 23 | return View(); 24 | } 25 | 26 | /// 27 | /// 封装一个方法来初始化OpenAuth客户端 28 | /// 29 | /// 30 | private SinaWeiboClient GetOpenAuthClient() 31 | { 32 | var accessToken = Session["access_token"] == null ? string.Empty : (string)Session["access_token"]; 33 | var uid = Request.Cookies["uid"] == null ? string.Empty : Request.Cookies["uid"].Value; 34 | 35 | var settings = ConfigurationManager.AppSettings; 36 | var client = new SinaWeiboClient(settings["appKey"], settings["appSecret"], settings["callbackUrl"], accessToken, uid); 37 | 38 | return client; 39 | } 40 | 41 | /// 42 | /// 授权认证 43 | /// 44 | /// 新浪返回的code 45 | /// 46 | public ActionResult Authorized(string code) 47 | { 48 | if (string.IsNullOrEmpty(code)) 49 | { 50 | return RedirectToAction("Index"); 51 | } 52 | 53 | 54 | var client = GetOpenAuthClient(); 55 | 56 | client.GetAccessTokenByCode(code); 57 | 58 | if (client.IsAuthorized) 59 | { 60 | //用session记录access token 61 | Session["access_token"] = client.AccessToken; 62 | //用cookie记录uid 63 | Response.AppendCookie(new HttpCookie("uid", client.UID) { Expires = DateTime.Now.AddDays(7) }); 64 | return RedirectToAction("Index"); 65 | } 66 | else 67 | { 68 | return RedirectToAction("Index"); 69 | } 70 | 71 | } 72 | 73 | /// 74 | /// 获取最新微博 75 | /// 76 | /// 77 | public ActionResult GetPublicTimeline() 78 | { 79 | var client = GetOpenAuthClient(); 80 | 81 | if (!client.IsAuthorized) 82 | { 83 | return Json(new 84 | { 85 | authorized = false, 86 | }); 87 | } 88 | // 调用获取当前登录用户及其所关注用户的最新微博api 89 | // 参考:http://open.weibo.com/wiki/2/statuses/friends_timeline 90 | var response = client.HttpGet("statuses/friends_timeline.json"); 91 | 92 | return Content(response.Content.ReadAsStringAsync().Result, "application/json"); 93 | 94 | 95 | } 96 | /// 97 | /// 获取用户信息 98 | /// 99 | /// 100 | public ActionResult GetUserState() 101 | { 102 | var client = GetOpenAuthClient(); 103 | 104 | if (!client.IsAuthorized) 105 | { 106 | return Json(new 107 | { 108 | authorized = false, 109 | url = client.GetAuthorizationUrl() 110 | }); 111 | } 112 | 113 | // 调用获取获取用户信息api 114 | // 参考:http://open.weibo.com/wiki/2/users/show 115 | var response = client.HttpGet("users/show.json", new 116 | { 117 | uid = client.UID 118 | }); 119 | 120 | if (response.IsSuccessStatusCode) 121 | { 122 | var json = new JObject(); 123 | json["authorized"] = true; 124 | json["data"] = JObject.Parse(response.Content.ReadAsStringAsync().Result); 125 | return Content(json.ToString(Formatting.None), "application/json"); 126 | } 127 | else 128 | { 129 | var json = new JObject(); 130 | json["authorized"] = false; 131 | json["data"] = JObject.Parse(response.Content.ReadAsStringAsync().Result); 132 | 133 | json["authorized"] = true; 134 | return Content(json.ToString(Formatting.None), "application/json"); 135 | } 136 | } 137 | /// 138 | /// 发微博 139 | /// 140 | /// 141 | /// 142 | /// 143 | public ActionResult PostStatus(string status, string img) 144 | { 145 | var imgFile = new FileInfo(Server.MapPath(string.Format("~/tmp/{0}", img))); 146 | 147 | var client = GetOpenAuthClient(); 148 | 149 | if (!client.IsAuthorized) 150 | { 151 | return Json(false); 152 | } 153 | 154 | if (imgFile.Exists) 155 | { 156 | // 调用发图片微博api 157 | // 参考:http://open.weibo.com/wiki/2/statuses/upload 158 | var response = client.HttpPost("statuses/upload.json", new 159 | { 160 | status = status, 161 | pic = imgFile //imgFile: 对于文件上传,这里可以直接传FileInfo对象 162 | }); 163 | 164 | if (response.IsSuccessStatusCode) 165 | { 166 | return Json(true); 167 | } 168 | else 169 | { 170 | return Json(false); 171 | } 172 | 173 | 174 | } 175 | else 176 | { 177 | // 调用发微博api 178 | // 参考:http://open.weibo.com/wiki/2/statuses/update 179 | var response = client.HttpPost("statuses/update.json", new 180 | { 181 | status = status 182 | }); 183 | 184 | if (response.IsSuccessStatusCode) 185 | { 186 | return Json(true); 187 | } 188 | else 189 | { 190 | return Json(false); 191 | } 192 | } 193 | } 194 | 195 | 196 | /// 197 | /// 上传图片 198 | /// 199 | /// 200 | /// 201 | public ActionResult UploadImage(HttpPostedFileBase file) 202 | { 203 | 204 | try 205 | { 206 | var img = new Bitmap(file.InputStream); 207 | 208 | var fileName = string.Format("{0:yyyyMMddHHmmss}{1}", DateTime.Now, file.FileName.Substring(file.FileName.LastIndexOf('.'))); 209 | 210 | file.SaveAs(Server.MapPath(string.Format("~/tmp/{0}", fileName))); 211 | 212 | return Json(new { success = true, fileName = fileName }); 213 | } 214 | catch 215 | { 216 | return Json(new { success = false }); 217 | } 218 | 219 | } 220 | 221 | 222 | 223 | } 224 | 225 | 226 | 227 | } 228 | -------------------------------------------------------------------------------- /MvcDemo/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using NetDimension.OpenAuth; 2 | using NetDimension.OpenAuth.Sina; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Configuration; 6 | using System.Linq; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | 10 | namespace MvcDemo.Controllers 11 | { 12 | public class HomeController : Controller 13 | { 14 | // 15 | // GET: /Home/ 16 | 17 | public ActionResult Index() 18 | { 19 | 20 | 21 | return View(); 22 | } 23 | 24 | 25 | public ActionResult GetAuthorizationState() 26 | { 27 | var settings = ConfigurationManager.AppSettings; 28 | 29 | var oauth = new SinaWeiboClient(settings["appKey"], settings["appSecret"], settings["callbackUrl"]); 30 | 31 | 32 | if (Request.Cookies["access_token"] == null || string.IsNullOrEmpty(Request.Cookies["access_token"].Value)) 33 | { 34 | return Json(new 35 | { 36 | authorized = false 37 | }, JsonRequestBehavior.AllowGet); 38 | } 39 | 40 | 41 | 42 | var accessToken = Request.Cookies["access_token"].Value; 43 | var uid = Request.Cookies["uid"].Value; 44 | 45 | oauth.AccessToken = accessToken; 46 | oauth.UID = uid; 47 | 48 | //较v2版的sdk,新的v3版sdk移除了所有的本地化api接口,因为新浪的接口变来变去,踩着滑板鞋也追不着他们魔鬼的步伐。 49 | //因此v3版的调用方式改为直接填写官方api名称和传递官方文档中要求的参数的方式来调用,返回结果需要自行使用json接卸器解析。 50 | var response = oauth.HttpGet("user/show.json", new 51 | { 52 | uid = uid 53 | }); 54 | 55 | 56 | return Json(response.Content.ReadAsStringAsync().Result, JsonRequestBehavior.AllowGet); 57 | 58 | } 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /MvcDemo/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MvcDemo.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MvcDemo/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Mvc; 7 | using System.Web.Routing; 8 | 9 | namespace MvcDemo 10 | { 11 | // 注意: 有关启用 IIS6 或 IIS7 经典模式的说明, 12 | // 请访问 http://go.microsoft.com/?LinkId=9394801 13 | public class MvcApplication : System.Web.HttpApplication 14 | { 15 | protected void Application_Start() 16 | { 17 | AreaRegistration.RegisterAllAreas(); 18 | 19 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 20 | RouteConfig.RegisterRoutes(RouteTable.Routes); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /MvcDemo/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NetDimension/WeiboSDK/9cdb3db53c407f9a8fe2252f720fe5557ba8d7a2/MvcDemo/Icon.png -------------------------------------------------------------------------------- /MvcDemo/MvcDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | 2.0 10 | {C4F823E1-D35F-4B93-9AB8-B2D9D64C15FD} 11 | {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 12 | Library 13 | Properties 14 | MvcDemo 15 | MvcDemo 16 | v4.0 17 | false 18 | true 19 | 20 | 21 | 22 | 23 | SAK 24 | SAK 25 | SAK 26 | SAK 27 | ..\ 28 | true 29 | 30 | 31 | 32 | true 33 | full 34 | false 35 | bin\ 36 | DEBUG;TRACE 37 | prompt 38 | 4 39 | 40 | 41 | pdbonly 42 | true 43 | bin\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | 51 | False 52 | ..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll 53 | 54 | 55 | 56 | 57 | 58 | ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll 59 | 60 | 61 | False 62 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.dll 63 | 64 | 65 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Extensions.dll 66 | 67 | 68 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Primitives.dll 69 | 70 | 71 | False 72 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.WebRequest.dll 73 | 74 | 75 | ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll 76 | 77 | 78 | ..\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | True 88 | ..\packages\Microsoft.AspNet.Mvc.4.0.40804.0\lib\net40\System.Web.Mvc.dll 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | True 101 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 102 | 103 | 104 | True 105 | ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll 106 | 107 | 108 | ..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll 109 | 110 | 111 | True 112 | ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll 113 | 114 | 115 | ..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll 116 | 117 | 118 | True 119 | ..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll 120 | 121 | 122 | True 123 | ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll 124 | 125 | 126 | True 127 | ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll 128 | 129 | 130 | True 131 | ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll 132 | 133 | 134 | 135 | 136 | 137 | 138 | Global.asax 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | Designer 180 | 181 | 182 | Web.config 183 | 184 | 185 | Web.config 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | {76fc909d-bda2-4fce-9b9f-b503a13df44f} 204 | NetDimension.OpenAuth.Sina 205 | 206 | 207 | {38b68338-7fc0-4ab7-b8a7-674e0bcbf899} 208 | NetDimension.OpenAuth 209 | 210 | 211 | 212 | 10.0 213 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | True 226 | True 227 | 4801 228 | / 229 | http://localhost:4801/ 230 | False 231 | False 232 | 233 | 234 | False 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 257 | -------------------------------------------------------------------------------- /MvcDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过下列特性集 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("MvcDemo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Net Dimension Studio")] 12 | [assembly: AssemblyProduct("MvcDemo")] 13 | [assembly: AssemblyCopyright("版权所有(C) Net Dimension Studio 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的某个类型, 19 | // 请针对该类型将 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("6efb0fce-df94-4fc6-a4fb-9dd4a4cca9f6")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 内部版本号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MvcDemo/Scripts/_references.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /MvcDemo/Scripts/jquery.upload.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery upload v1.2 3 | * http://www.ponxu.com 4 | * 5 | * @author xwz 6 | */ 7 | (function($) { 8 | var noop = function(){ return true; }; 9 | var frameCount = 0; 10 | 11 | $.uploadDefault = { 12 | url: '', 13 | fileName: 'filedata', 14 | dataType: 'json', 15 | params: {}, 16 | onSend: noop, 17 | onSubmit: noop, 18 | onComplate: noop 19 | }; 20 | 21 | $.upload = function(options) { 22 | var opts = $.extend(jQuery.uploadDefault, options); 23 | if (opts.url == '') { 24 | return; 25 | } 26 | 27 | var canSend = opts.onSend(); 28 | if (!canSend) { 29 | return; 30 | } 31 | 32 | var frameName = 'upload_frame_' + (frameCount++); 33 | var iframe = $('