我刚刚开始使用SL4运行VS2010时遇到此Javascript错误
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
Run Code Online (Sandbox Code Playgroud)
一切都运行正常,更改了1行代码以在Web项目中使用RegularExpression(使用Silverlight业务应用程序模板),然后在重建时出现此错误.
谷歌称这是与IIS和mimetype相关的.我在VS2010上使用的是Cassini而不是IIS.
从IE缓存重新启动,清除xap.IE和FF都出错.
可能有什么不对?
通过检查二进制结构,我已经看到了一些检查PEFile是否是.NET程序集的方法.
这是测试多个文件的最快方法吗?我假设尝试加载每个文件(例如通过Assembly.ReflectionOnlyLoad)文件可能会很慢,因为它将加载文件类型信息.
注意:我正在寻找一种以编程方式检查文件的方法.
我们正在为一家端到端使用Microsoft产品的公司选择工作流程解决方案.鉴于WF4的新闻,它似乎基本上是对以前版本的重写,是支持当前版本的明智之举还是我们应该在其他地方寻找?
即 - 目前的版本是如此糟糕,以至于我们尝试使用它是不明智的吗?
我得到下面的代码,试图将图像从Web加载到Image控件,当我运行它时,我得到一个错误的给定行,不允许网络访问:
private void button1_Click(object sender, RoutedEventArgs e)
{
WebClient webClientImgDownloader = new WebClient();
webClientImgDownloader.OpenReadCompleted += new OpenReadCompletedEventHandler(webClientImgDownloader_OpenReadCompleted);
webClientImgDownloader.OpenReadAsync(new Uri("http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/80000/5000/100/85108/85108.strip.print.gif", UriKind.Absolute));
}
void webClientImgDownloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(e.Result); // ERROR HERE!
image1.Source = bitmap;
}
Run Code Online (Sandbox Code Playgroud)
适用于Windows Phone 7的Silverlight
我有以下XAML(带有自定义DataTemplate的简单列表框).我正在试图弄清楚如何突出显示所选项目(可能是背景颜色变化).我想我需要在Expression Blend中使用Styles做一些事情,但我不太确定从哪里开始......编辑:经过一段时间的游戏我现在有了这个(似乎什么也没做)
<phone:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
x:Class="SqueezeBox.StartPage"
d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<Style x:Key="HighlightItemStyle" TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<StackPanel x:Name="DataTemplateStackPanel" Orientation="Horizontal">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0" To="Selected">
<Storyboard>
<ColorAnimation Duration="0" To="#FFFD0D0D" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="ItemText" d:IsOptimized="True"/>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Unselected"/>
<VisualState x:Name="Selected"/>
<VisualState x:Name="SelectedUnfocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Image x:Name="ItemImage" Source="{Binding ThumbnailAlbumArtUri}" Height="62" Width="62" VerticalAlignment="Top" Margin="10,0,20,0"/>
<StackPanel x:Name="stackPanel">
<TextBlock x:Name="ItemText" Text="{Binding Name}" Margin="-2,-13,0,0" Style="{StaticResource PhoneTextExtraLargeStyle}" d:IsHidden="True"/> …Run Code Online (Sandbox Code Playgroud) 我有一个包含此代码的Windows服务:
public static void ExtractTextInner(string source, string destination)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = EXTRACTOR_EXE_FILEPATH
startInfo.Arguments = "\"" + source + "\" \"" + destination + "\"";
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process process = new Process();
process.StartInfo = startInfo;
process.Start();
process.WaitForExit();
int exitCode = process.ExitCode;
process.Close();
if (exitCode != 0)
{
switch (exitCode)
{
case 1:
throw new ApplicationException("IFilter Extraction Failed");
default:
throw new ApplicationException("Unknown Exit Code:" + exitCode.ToString());
}
}
}
Run Code Online (Sandbox Code Playgroud)
这段代码的目的是在文档上运行IFilter提取,我们使用一个单独的过程,因为一些IFilter是众所周知的片状.
现在,此代码在Windows 7和Server 2008 …
我正在对使用经典ASP/VbScript编写的旧应用程序进行一些修改.
它具有向应用程序成员发送电子邮件的功能,但由于成员列表非常大,服务器在发送前一百个左右后拒绝新的电子邮件.
我写了一些代码,让它发送20个爆炸的电子邮件,但这仍然不起作用.我认为也许让它在爆发之间睡一会儿可能会正常工作.
但是,我似乎无法在VbScript中找到Thread.Sleep类型方法.
有吗?
有可能做这样的事情:
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Grid />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Text}" Grid.Column="{Binding Column}" Grid.Row="{Binding Row}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
项源类似于具有Text,Column和Row属性的对象List.
这可能吗?我真的希望我的数据网格是数据绑定的.
我一直在使用Silverlight工具包,但我发现质量缺乏; 特别是这个内存泄漏/幻像点错误使得Chart组件完全无法使用.
任何人都可以为Silverlight 4.0推荐一个好的图表/图形组件吗?我正在寻找一个提供:
最后一点听起来微不足道,但却绊倒了Silverlight Toolkit Chart; 如果你快速改变轴范围,除了它应该显示的点之外,它有时会留下幻影点.
silverlight ×5
c# ×3
.net ×2
asp-classic ×2
.net-3.5 ×1
charts ×1
clr ×1
graphing ×1
grid ×1
listbox ×1
reflection ×1
vbscript ×1
workflow ×1