.net 是否有用于为Windows Phone 7应用程序生成Microsoft标记的URL?
我正在开发一个以WindowsPhone7应用程序为特色的网站,我想加入一个微软标签,这样用户可以将手机指向屏幕并下载该应用程序 到目前为止,他们的网站已经被证明是毫无帮助的,而且如果你不想手动生成它们,你似乎需要注册API.net 是否有用于为Windows Phone 7应用程序生成Microsoft标记的URL?,.net,windows-phone-7,microsoft-tag,.net,Windows Phone 7,Microsoft Tag,我正在开发一个以WindowsPhone7应用程序为特色的网站,我想加入一个微软标签,这样用户可以将手机指向屏幕并下载该应用程序 到目前为止,他们的网站已经被证明是毫无帮助的,而且如果你不想手动生成它们,你似乎需要注册API 我想知道是否有一个URL,我可以将应用程序ID放入其中,托管在Microsoft的服务器上,为我生成标记?您看到这些页面了吗: 如果您只需要一个标签将手机浏览器重定向到应用程序下载站点,我建议您只需创建一个Microsoft标签帐户并将标签创建为“一次性”:在标签管理
我想知道是否有一个URL,我可以将应用程序ID放入其中,托管在Microsoft的服务器上,为我生成标记?您看到这些页面了吗:
使用系统;
使用System.IO;
使用MakeTags.Tag;
命名空间标记{
班级计划{
静态void Main(字符串[]参数){
MIBPContractClient标记服务=新的MIBPContractClient();
UserCredential creds=新的UserCredential();
creds.AccessToken=“此处的访问令牌”;
int tagsToCreate=10;
字符串category=“Main”;
字符串tagTitlePrefix=“我的样本标签”;
字符串tagImageFilePathFormat=“mytag{0}.png”;
对于(int i=0;i
是的,不幸的是,它允许您注册标签管理器和API。我希望有更通用的东西。这是一个非常好的解决方案,只适用于少数几个应用程序,但这个项目很可能每周需要生成几个标记。在这种情况下,我只能建议您考虑创建一个小型库来包装Microsoft标记API:它非常非常简单。:)看起来这就是我要做的:)干杯。
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);
}
}
}
}