背景:
C:\windows\Winsxs文件夹policies和ManifestsWinsxs具有 policies 相同的命名格式。例如文件夹名称:
x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963ex86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f75 据我所知,名称的第一部分(x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1)描述了程序集或策略的“processorArchitecture”( x86),“Name”(Microsoft.VC90.CRT),“publicKeyToken”(1fc8b3b9a1e18e3b)和“Version”( )。9.0.30729.1
问题:
assembly( x-ww_6f74963e) 或policy( x-ww_b7353f75) 文件夹名称的最后一部分描述了什么?
好的,这是原始问题(但故事很长)。我在 Windows XP 计算机上部署了 C++ MFC 应用程序,该计算机先前安装了一些 C++ 重新分发包和一些运行时程序集的安全补丁。因此,这些预安装的 C++ 重新分发包会自动在Winsxs/policies. 这些策略强制使用新的运行时程序集,而不是我的应用程序使用和部署的程序集。但有时,由于某些其他应用程序删除或程序集可能损坏,这些较新的 DLL 不存在。因此,我正在寻找一种方法来部署专门用于我的应用程序的运行时程序集(这意味着我的应用程序必须使用它部署的一次程序集并忽略策略)。所以我认为子目录名称的最后一部分与应用程序的身份相关联。我需要找到它。
在 .NET 中,有一个类可以将文本 HTML 颜色名称转换为颜色(在本例中为“红色”):
Color col=(Color)ColorConverter.ConvertFromString("Red");
Brush brush=new SolidColorBrush(col);
Run Code Online (Sandbox Code Playgroud)
(我从这里获取:Cast Color Name to SolidColorBrush)
这几乎适用于维基百科上可以找到的所有颜色
是否有一个等效的类/库Windows Store Apps可以做同样的事情?
如何在 WinRT 中处置由 XAML 代码创建的控件?我创建了ImageSlideShow使用SempahoreSlimand DispatcherTimer(我使用timer.Tick事件)的UserControl。我应该将 .Unloaded 事件处理程序添加到ImageSlideShow用户控件或实现 IDisposable (xaml 是否负责调用 .Dispose?)以释放资源和事件处理程序 - 或者我是否需要像在代码隐藏中创建的控件一样手动处理它?
我正在尝试将一些东西放在一起,以使用 AD 缩略图照片在 Windows 8 上设置用户的帐户图片。看来我应该能够使用 WinRT 的 API 来执行此操作。我从各种来源拼凑了一些有关从 powershell 调用 API 的信息,但我无法让它工作。这是我尝试做的一个例子:
\n$photo = ([ADSISEARCHER]\xe2\x80\x9csamaccountname=$($username)\xe2\x80\x9d).findone().properties.thumbnailphoto\n$path = "C:\\temp\\Photo.jpg"\n$photo | set-content $path -encoding byte\n\n\n[Windows.System.UserProfile.UserInformation,Windows.System.UserProfile,ContentType=WindowsRuntime] > $null\n[Windows.System.UserProfile.UserInformation]::SetAccountPictureAsync($photo)\nRun Code Online (Sandbox Code Playgroud)\n我尝试了其他一些变体,但无论我做什么,我最终都会遇到这样的错误:
\nCannot convert argument "image", with value: "System.Object[]", for "setAccountPictureAsync" to type "Windows.Storage.IStorageFile" . . . \nRun Code Online (Sandbox Code Playgroud)\n我是否缺少一些简单的东西来完成这项工作?
\n我发现Keith Hill 的这篇博文似乎可能有帮助,但我不确定它是否直接转化为我遇到的问题。
\n谢谢!
\n奥罗克
\n为什么在此示例中未触发 ImageOpened 事件?我在 Win8 的 WinRT 应用程序中使用它。
BitmapImage myImage = new BitmapImage();
myImage.ImageOpened += myImage_ImageOpened;
myImage.UriSource = new Uri("ms-appx:/Assets/Image.png");
private void myImage_ImageOpened(object sender, RoutedEventArgs e)
{
int pixelHeight = (sender as BitmapImage).PixelHeight;
}
Run Code Online (Sandbox Code Playgroud)
我的问题是 ImageOpened 事件没有被触发。我想检查图像的 PixelHeight 和 PixelWidth,但如果没有收到此事件,则无法检查。
我有一个这样的正则表达式:
name = dr-det-fb.ydp.eu/ebook/trunk/annotations/ctrl.php/api1751-4060-1193-0487
name = Regex.Replace(name, @"/\W/g", "");
Run Code Online (Sandbox Code Playgroud)
此正则表达式应替换“/”、“-”、“。” 和 ””。但它没有,有人可以解释我为什么吗?
场景:Visual Studio 2013 Ultimate 版本 4。Windows 8.1 通用项目。C#。我需要一个 Windows 运行时组件来定期更新我的动态磁贴。解决方案构建以错误消息结束:
“winmdexp.exe”退出,代码为-532462766
在过去的 2-1/2 天里我一直在寻找线索。没有什么比这更接近的了。此解决方案中的三个项目中的任何代码都没有语法错误。至少有人能给我指出一个方向吗?
我有 ItemsControl,每个项目都有可绑定的 itemsource 和自定义 datetemplate。项目由行分隔。但是最后一项也有分隔符,这就是我的问题,如何不为最后一项渲染行。我找到了这个解决方案,但它在 WPF 中有效:
编辑: 这是我的模板:
<ItemsControl Grid.Row="1" ItemsSource="{x:Bind ViewModel.AvailableStatuses}" x:Name="Statuses">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" Padding="60,0,60,12"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<i:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="Tapped">
<core:InvokeCommandAction Command="{Binding ElementName=ContentGrid, Path=DataContext.ChangeStatusCommand}" CommandParameter="{Binding}"/>
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Rectangle StrokeThickness="0.4" Height="0.4" x:Name="Separator"
VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Stroke="#D1D3D4" />
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Stretch">
<Image Source="{Binding Converter={StaticResource SelectContactStatusConverter}}" Margin="0,8,12,8"/>
<TextBlock Text="{Binding Converter={StaticResource EnumContactStatusToTextConverter}}" FontSize="20" VerticalAlignment="Center" Foreground="Black"/>
</StackPanel>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Run Code Online (Sandbox Code Playgroud) 我没有清楚地了解COM(组件对象模型)和WinRT(Windows 运行时)之间的相似/差异或关系本身。
根据我的理解,它们都是为了提供“运行时引擎”来使组件能够进行通信......这是 CLR(公共语言运行时)吗?
WinRT 随 Windows 8 一起出现,为多种语言提供了一个通用平台。
我不明白的是,WinRT 是否取代了 COM?它们是一样的吗?
我正在尝试编译这个项目:https ://github.com/bucienator/ble-win-cpp
克隆存储库后,我收到错误“wait_for”不是“winrt :: impl”的成员。使用 NuGet,我将 Microsoft.Windows.CppWinRT 包添加到项目中。但之后我对所有库的导入都中断了:
#include <winrt / Windows.Foundation.h>
#include <winrt / Windows.Devices.Bluetooth.h>
#include <winrt / Windows.Devices.Enumeration.h>
#include <winrt / Windows.Devices.Bluetooth.Advertisement.h>
#include <winrt / Windows.Devices.Bluetooth.GenericAttributeProfile.h>
#include <winrt / Windows.Storage.Streams.h>
Run Code Online (Sandbox Code Playgroud)
告诉我如何让 Visual Studio 编译我的项目?
windows-runtime ×10
c# ×7
xaml ×3
.net ×1
bitmapimage ×1
c++ ×1
com ×1
cppwinrt ×1
events ×1
powershell ×1
regex ×1
uwp ×1
uwp-xaml ×1
windows ×1
windows-8 ×1
winrt-xaml ×1
winsxs ×1