clq1010 лет назад: 9
Сommit
e215f248f1

+ 22 - 0
SMS/SMS.sln

@@ -0,0 +1,22 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio 14
4
+VisualStudioVersion = 14.0.25420.1
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SMS", "SMS\SMS.csproj", "{5709D086-AB2A-448D-8645-9C3B0F37E9EB}"
7
+EndProject
8
+Global
9
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10
+		Debug|Any CPU = Debug|Any CPU
11
+		Release|Any CPU = Release|Any CPU
12
+	EndGlobalSection
13
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
14
+		{5709D086-AB2A-448D-8645-9C3B0F37E9EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15
+		{5709D086-AB2A-448D-8645-9C3B0F37E9EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16
+		{5709D086-AB2A-448D-8645-9C3B0F37E9EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17
+		{5709D086-AB2A-448D-8645-9C3B0F37E9EB}.Release|Any CPU.Build.0 = Release|Any CPU
18
+	EndGlobalSection
19
+	GlobalSection(SolutionProperties) = preSolution
20
+		HideSolutionNode = FALSE
21
+	EndGlobalSection
22
+EndGlobal

+ 6 - 0
SMS/SMS/App.config

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
+    </startup>
6
+</configuration>

+ 32 - 0
SMS/SMS/Program.cs

@@ -0,0 +1,32 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using Top.Api;
7
+using Top.Api.Request;
8
+using Top.Api.Response;
9
+
10
+namespace SMS
11
+{
12
+    class Program
13
+    {
14
+        static void Main(string[] args)
15
+        {
16
+            string url = "http://gw.api.taobao.com/router/rest";
17
+            string appkey = "23597669";
18
+            string secret = "10754230f98b19f43becfa3a2b599182";
19
+            ITopClient client = new DefaultTopClient(url, appkey, secret);
20
+            AlibabaAliqinFcSmsNumQueryRequest req = new AlibabaAliqinFcSmsNumQueryRequest();
21
+            req.BizId = "1234^1234";//短信发送流水
22
+            req.RecNum = "18530043966";
23
+            req.QueryDate = "20170110";
24
+            req.CurrentPage = 1L;//分页参数,页码
25
+            req.PageSize = 10L;//分页参数,每页数量。最大值50
26
+            AlibabaAliqinFcSmsNumQueryResponse rsp = client.Execute(req);
27
+            Console.WriteLine(rsp.Body);
28
+            Console.ReadLine();
29
+
30
+        }
31
+    }
32
+}

+ 36 - 0
SMS/SMS/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// 有关程序集的一般信息由以下
6
+// 控制。更改这些特性值可修改
7
+// 与程序集关联的信息。
8
+[assembly: AssemblyTitle("SMS")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("Microsoft")]
12
+[assembly: AssemblyProduct("SMS")]
13
+[assembly: AssemblyCopyright("Copyright © Microsoft 2017")]
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("5709d086-ab2a-448d-8645-9c3b0f37e9eb")]
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")]

+ 70 - 0
SMS/SMS/SMS.cs

@@ -0,0 +1,70 @@
1
+using System;
2
+using Top.Api;
3
+using Top.Api.Request;
4
+using Top.Api.Response;
5
+
6
+namespace SMS
7
+{
8
+    public class SMS
9
+    {
10
+
11
+        /// <summary>
12
+        /// 发送短信
13
+        /// </summary>
14
+        /// <param name="url">API服务地址 正式环境http://gw.api.taobao.com/router/rest</param>
15
+        /// <param name="appkey">App Key</param>
16
+        /// <param name="secret">App Secret</param>
17
+        /// <param name="signname">短信签名 传入的短信签名必须是在阿里大于“管理中心-短信签名管理”中的可用签名。</param>
18
+        /// <param name="smsparam">短信模板变量 key的名字须和申请模板中的变量名一致,多个变量之间以逗号隔开。示例:{"code":"1234","product":"alidayu"}</param>
19
+        /// <param name="recnum">短信接收号码。支持单个或多个手机号码,传入号码为11位手机号码,不能加0或+86。群发短信需传入多个号码,以英文逗号分隔,一次调用最多传入200个号码。示例:18600000000,13911111111,13322222222</param>
20
+        /// <param name="smstemplate">短信模板ID,传入的模板必须是在阿里大于“管理中心-短信模板管理”中的可用模板。示例:SMS_585014</param>
21
+        /// <returns></returns>
22
+        public string SendSMS(string url, string appkey, string secret,string signname,string smsparam,string recnum,string smstemplate)
23
+        {
24
+            string result = string.Empty;
25
+            ITopClient client = new DefaultTopClient(url, appkey, secret);
26
+            AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
27
+            req.Extend = "123456";//公共回传参数
28
+            req.SmsType = "normal";//短信类型,传入值请填写normal
29
+            req.SmsFreeSignName = signname;//签名 
30
+            req.SmsParam = smsparam; //示例: "{\"name\":\"张三\",\"time\":\"11:00\"}";
31
+            req.RecNum = recnum; //短信接收号码
32
+            req.SmsTemplateCode = smstemplate;//短信模板ID
33
+            AlibabaAliqinFcSmsNumSendResponse rsp = client.Execute(req);
34
+            if (rsp.Result.Success)
35
+            {
36
+                result = "success";
37
+            }
38
+            else
39
+            {
40
+                result = rsp.Result.ErrCode;//错误码
41
+            }
42
+            return result;
43
+        }
44
+
45
+        /// <summary>
46
+        /// 短信发送记录查询
47
+        /// </summary>
48
+        /// <param name="url">API服务地址 正式环境http://gw.api.taobao.com/router/rest</param>
49
+        /// <param name="appkey">App Key</param>
50
+        /// <param name="secret">App Secret</param>
51
+        /// <param name="recnum">短信接收号码 示例:13000000000</param>
52
+        /// <param name="querydate">短信发送日期,支持近30天记录查询,格式yyyyMMdd</param>
53
+        /// <param name="currentpage">分页参数,页码</param>
54
+        /// <param name="pagesize">分页参数,每页数量。最大值50</param>
55
+        /// <returns></returns>
56
+        public string SendSMSRecord(string url, string appkey, string secret,string recnum,string querydate,int currentpage,int pagesize)
57
+        {
58
+            string result = string.Empty;
59
+            ITopClient client = new DefaultTopClient(url, appkey, secret);
60
+            AlibabaAliqinFcSmsNumQueryRequest req = new AlibabaAliqinFcSmsNumQueryRequest();
61
+            req.BizId = "1234^1234";//短信发送流水
62
+            req.RecNum = recnum;
63
+            req.QueryDate = querydate;
64
+            req.CurrentPage = currentpage;
65
+            req.PageSize = pagesize;
66
+            AlibabaAliqinFcSmsNumQueryResponse rsp = client.Execute(req);
67
+            return rsp.Body.ToString();
68
+        }
69
+    }
70
+}

+ 64 - 0
SMS/SMS/SMS.csproj

@@ -0,0 +1,64 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{5709D086-AB2A-448D-8645-9C3B0F37E9EB}</ProjectGuid>
8
+    <OutputType>Exe</OutputType>
9
+    <AppDesignerFolder>Properties</AppDesignerFolder>
10
+    <RootNamespace>SMS</RootNamespace>
11
+    <AssemblyName>SMS</AssemblyName>
12
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13
+    <FileAlignment>512</FileAlignment>
14
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15
+  </PropertyGroup>
16
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
+    <PlatformTarget>AnyCPU</PlatformTarget>
18
+    <DebugSymbols>true</DebugSymbols>
19
+    <DebugType>full</DebugType>
20
+    <Optimize>false</Optimize>
21
+    <OutputPath>bin\Debug\</OutputPath>
22
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
23
+    <ErrorReport>prompt</ErrorReport>
24
+    <WarningLevel>4</WarningLevel>
25
+  </PropertyGroup>
26
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27
+    <PlatformTarget>AnyCPU</PlatformTarget>
28
+    <DebugType>pdbonly</DebugType>
29
+    <Optimize>true</Optimize>
30
+    <OutputPath>bin\Release\</OutputPath>
31
+    <DefineConstants>TRACE</DefineConstants>
32
+    <ErrorReport>prompt</ErrorReport>
33
+    <WarningLevel>4</WarningLevel>
34
+  </PropertyGroup>
35
+  <ItemGroup>
36
+    <Reference Include="System" />
37
+    <Reference Include="System.Core" />
38
+    <Reference Include="System.Xml.Linq" />
39
+    <Reference Include="System.Data.DataSetExtensions" />
40
+    <Reference Include="Microsoft.CSharp" />
41
+    <Reference Include="System.Data" />
42
+    <Reference Include="System.Net.Http" />
43
+    <Reference Include="System.Xml" />
44
+    <Reference Include="TopSdk">
45
+      <HintPath>..\..\..\..\..\..\..\TopSdk.dll</HintPath>
46
+    </Reference>
47
+  </ItemGroup>
48
+  <ItemGroup>
49
+    <Compile Include="Program.cs" />
50
+    <Compile Include="Properties\AssemblyInfo.cs" />
51
+    <Compile Include="SMS.cs" />
52
+  </ItemGroup>
53
+  <ItemGroup>
54
+    <None Include="App.config" />
55
+  </ItemGroup>
56
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
58
+       Other similar extension points exist, see Microsoft.Common.targets.
59
+  <Target Name="BeforeBuild">
60
+  </Target>
61
+  <Target Name="AfterBuild">
62
+  </Target>
63
+  -->
64
+</Project>

+ 6 - 0
SMS/SMS/bin/Debug/SMS.exe.config

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
+    </startup>
6
+</configuration>

+ 6 - 0
SMS/SMS/bin/Debug/SMS.vshost.exe.config

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
+    </startup>
6
+</configuration>

+ 11 - 0
SMS/SMS/bin/Debug/SMS.vshost.exe.manifest

@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5
+    <security>
6
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7
+        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
8
+      </requestedPrivileges>
9
+    </security>
10
+  </trustInfo>
11
+</assembly>

+ 6 - 0
SMS/SMS/obj/Debug/SMS.csproj.FileListAbsolute.txt

@@ -0,0 +1,6 @@
1
+C:\Users\YP\documents\visual studio 2015\Projects\SMS\SMS\bin\Debug\SMS.exe.config
2
+C:\Users\YP\documents\visual studio 2015\Projects\SMS\SMS\bin\Debug\SMS.exe
3
+C:\Users\YP\documents\visual studio 2015\Projects\SMS\SMS\bin\Debug\SMS.pdb
4
+C:\Users\YP\documents\visual studio 2015\Projects\SMS\SMS\bin\Debug\TopSdk.dll
5
+C:\Users\YP\documents\visual studio 2015\Projects\SMS\SMS\obj\Debug\SMS.exe
6
+C:\Users\YP\documents\visual studio 2015\Projects\SMS\SMS\obj\Debug\SMS.pdb

+ 0 - 0
SMS/SMS/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs


+ 0 - 0
SMS/SMS/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs


+ 0 - 0
SMS/SMS/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs