gpt4 book ai didi

.net - 是否有用于为 Windows Phone 7 应用程序生成 Microsoft 标签的 URL?

转载 作者:行者123 更新时间:2023-12-02 13:21:35 24 4
gpt4 key购买 nike

我正在开发一个将提供 Windows Phone 7 应用程序的网站,我希望包含一个 Microsoft 标签,以便用户可以将手机指向屏幕并下载所提供的应用程序。

到目前为止,他们的网站已被证明毫无帮助,如果您不想手动生成所有这些内容,则似乎需要注册该 API。

我想知道是否有一个 URL 可供我放置应用 ID,托管在 Microsoft 的服务器上,为我生成标记?

最佳答案

不只有一个网址可以为您创建标签。但这是 Stack Overflow,这是一个简短的程序,它使用 Tag API 创建任意数量的标签。为了使程序正常运行,您需要:

  1. 添加对 Tag API 的服务引用:https://ws.tag.microsoft.com/MIBPService.wsdl
  2. 确保将您自己的标签 API key 插入到creds.AccessToken中。
  3. app.config 中的 maxArrayLength="16384" 值增加到更高的值。这是从 Web 服务中提取 ~45KB 标签图像所必需的。我用了100000。

完整的博客文章位于http://flyingpies.wordpress.com/2011/05/25/creating-several-microsoft-tags/ .

using System;
using System.IO;
using MakeTags.Tag;

namespace MakeTags {
class Program {
static void Main(string[] args) {
MIBPContractClient tagService = new MIBPContractClient();
UserCredential creds = new UserCredential();
creds.AccessToken = "your-access-token-here";

int tagsToCreate = 10;
string category = "Main";
string tagTitlePrefix = "My Sample Tag ";
string tagImageFilePathFormat = "mytag{0}.png";

for (int i = 0; i < tagsToCreate; ++i) {
Console.WriteLine("Creating tag " + i);

string tagTitle = tagTitlePrefix + i;

URITag tag = new URITag();
tag.Title = tagTitle;
tag.MedFiUrl = "http://flyingpies.wordpress.com/2011/05/24/creating-several-microsoft-tags";
tag.UTCStartDate = DateTime.UtcNow;
tagService.CreateTag(creds, category, tag);

string tagImageFilePath = string.Format(tagImageFilePathFormat, i);
byte[] tagImageBytes = tagService.GetBarcode(
creds,
category,
tagTitle,
ImageTypes.png,
1f,
DecorationType.HCCBRP_DECORATION_DOWNLOAD,
false);
File.WriteAllBytes(tagImageFilePath, tagImageBytes);
}
}
}
}

关于.net - 是否有用于为 Windows Phone 7 应用程序生成 Microsoft 标签的 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6091737/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com