我正在用C#开发智能设备应用程序.我正在调用Web服务.Web服务方法返回谷歌地图.方法的返回类型是object.该对象包含字节格式的图像.该对象以base64binary格式包含图像.我需要在我的应用程序中显示实际图像.我需要做什么类型的投射才能显示图像.您能否提供我可以解决上述问题的代码或链接?
我正在开发windows phone 7应用程序.我是窗口手机7应用程序的新手.我通过右键单击项目并选择Add - > New Item在我的项目中添加了XML文件.然后,我可以使用以下代码轻松地在我的应用程序中加载XML文件
IsolatedStorageFile isfData = IsolatedStorageFile.GetUserStoreForApplication();
XDocument doc = null;
IsolatedStorageFileStream isfStream = null;
if (isfData.FileExists(strXMLFile))
{
isfStream = new IsolatedStorageFileStream(strXMLFile, FileMode.Open, isfData);
doc = XDocument.Load(isfStream);
isfStream.Close();
}
else
{
doc = XDocument.Load(strXMLFile);
isfStream = new IsolatedStorageFileStream(strXMLFile, FileMode.CreateNew, isfData);
doc.Save(isfStream);
isfStream.Close();
}
Run Code Online (Sandbox Code Playgroud)
通过使用上面的代码,我可以在我的XML文件中执行读写操作.
但是当我将XML文件放入文件夹时出现了问题.我的问题如下:通过右键单击项目名称并在visual studio中选择Add - > New Folder,我在项目中添加了一个名为'XML Files'的文件夹.然后我通过右键单击文件夹并选择Add-> New Item将XML文件添加到'XML Files'文件夹中.当我将XML文件放入文件夹时,我无法在我的应用程序中加载它.我也尝试过以下声明
isfStream = new IsolatedStorageFileStream("/XML Files/"+strXMLFile, FileMode.Open, isfData);
Run Code Online (Sandbox Code Playgroud)
我收到错误
doc = XDocument.Load(strXMLFile);
Run Code Online (Sandbox Code Playgroud)
我在应用程序xap包中收到错误"无法找到文件'/ XML Files/A.xml'." 我该怎么办 ?如何加载文件夹内的XML文件?我的代码有什么问题吗?能否请您提供我可以解决上述问题的任何代码或链接?
我正在开发windows phone 7应用程序.我是窗口手机7应用程序的新手.我的应用程序中有以下列表框控件
<ListBox Margin="0,355,70,205" Name="WeekSummaryListBox" DataContext="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Amount}" Foreground="Orange"></TextBlock>
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Currency}" Foreground="Orange"></TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Template>
<ControlTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
在上面的列表框中,控件项目是垂直显示的.我想在列表框控件中显示项目.所以我使用以下代码.
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
Run Code Online (Sandbox Code Playgroud)
但是当我将两个文本块放在stackpanel中时,它会出错.为此,我使用以下代码
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Amount}" Foreground="Orange"></TextBlock>
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Currency}" Foreground="Orange"></TextBlock>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
我正在尝试以下代码.在下面的代码中我收到错误
<ListBox Margin="0,355,70,205" Name="WeekSummaryListBox" DataContext="{Binding}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Amount}" Foreground="Orange"></TextBlock>
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Currency}" Foreground="Orange"></TextBlock> …Run Code Online (Sandbox Code Playgroud) C#中方法隐藏和阴影有什么区别?它们是相同还是不同?我们可以将它们称为多态(编译时或运行时)吗?
我的同事最近向我询问了这个问题.我知道在LoadViewSate方法中的InitComplete和Preload事件之间可以使用ViewState.同样,我想知道在哪个页面生命周期事件中我们可以为特定页面分配母版页?
我正在开发Windows移动应用程序.我正在使用SQLlite数据库.我使用以下代码连接到此数据库,如下所示
SQLiteConnection cn = new SQLiteConnection();
SQLiteDataReader SQLiteDR;
cn.ConnectionString = @"Data Source=F:\CompNetDB.db3";
cn.Open();
SQLiteCommand cmd = new SQLiteCommand();
cmd.CommandText = "select * from CustomerInfo";
cmd.CommandType = CommandType.Text;
cmd.Connection = cn;
SQLiteDR = cmd.ExecuteReader();
Run Code Online (Sandbox Code Playgroud)
在上面的例子中,我收到错误"找不到PInvike DLL SQLite.interop.dll".我已经从\ SQLite.NET\bin\compactframework这个文件夹中添加了DLL System.Data.SQLLite.这是我安装SQLite时默认安装的文件夹.在同一文件夹中有一个名为SQLlite.Interop.66.DLL的DLL文件.当我尝试添加对此dll的引用时,它给出了无法添加dll的错误.这两个dll SQLlite.Interop.dll和System.Interop.066.dll是一样的吗?在上面的代码中如何解决错误"找不到PInvoke.SQLite.Interop.dll"请问您能否判断我的代码中是否有错误或者我的应用程序中缺少某些内容?
我正在开发windows phone 7应用程序.我是银光的新手.在我的应用程序中,我需要一个动态组合框.所以我使用以下代码
ComboBox CurrenciesCombobox = null;
CurrenciesCombobox = new ComboBox();
CurrenciesCombobox.Name = "CurrencyCombobox";
CurrenciesCombobox.SetValue(Canvas.TopProperty, 10.00);
CurrenciesCombobox.SetValue(Canvas.LeftProperty, 10.00);
CurrenciesCombobox.Margin = new Thickness(235, 395, 139, 180);
//CurrenciesCombobox.Foreground = ;
CurrenciesCombobox.ItemsSource = Currencies;
CurrenciesCombobox.SelectionChanged += new SelectionChangedEventHandler(CurrenciesCombobox_SelectionChanged);
ContentPanel.Children.Add(CurrenciesCombobox);
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我不知道如何设置以下语句的右侧
CurrenciesCombobox.Foreground = ;
Run Code Online (Sandbox Code Playgroud)
你能告诉我如何设置combobx的Foreground属性吗?能否请您提供我可以解决上述问题的任何代码或链接?如果我做错了什么,请指导我.
我正在用C#开发wpf应用程序.我已经在visual studio 2010中成功创建了wpf应用程序的安装项目.我使用MS Access 2010作为数据库.它安装在所有计算机上.但在某些计算机上没有安装Microsoft Office,在某些计算机上有MS Office的较低版本,如MS Office 2003.当我在这些计算机上安装我的应用程序时,它会给我带来连接问题.你能告诉我我该怎么办?我是否需要在Visual Studio 2010安装项目中包含MS Access 2010的任何先决条件?如果有什么是它们以及如何包含它们?
我正在开发windows phone 7应用程序.我是窗口手机7应用程序的新手.我也是XML Serialization和LINQ to XML的新手.我正在使用XML作为当前应用程序的数据库.我发现我有两个选项来存储和检索隔离存储中的值.我可以使用XML Serialization,也可以使用简单的LINQ to XML.对于XML序列化,我指的是以下链接
http://www.codeproject.com/KB/windows-phone-7/wp7rssreader.aspx
对于使用简单的LINQ to XML,我指的是以下链接.
http://rongchaua.net/blog/windows-phone-7-simple-database-example/
在我当前的应用程序中,我只想添加和检索XML文件中的值作为数据库.我当前的应用程序没有外部系统接口.我当前的应用程序不依赖于任何其他应用程序和其他应用程序没有使用我的应用程序的数据.你能否告诉我是否应该进一步参考第一个链接或第二个链接?请告诉我通过上述方法的主要原因.如果我做错了什么,请指导我.如果有人比上述两种技术有更好的想法,请分享想法.
c# silverlight xml-serialization linq-to-xml windows-phone-7
我正在开发windows phone 7应用程序.我是窗口手机7应用程序的新手.我在我的应用程序中有Listbox,我正在动态创建按钮控件并将它们添加到列表框控件中.现在我想为每个动态创建的按钮控件设置背景图像.我使用以下代码动态设置按钮控件的背景颜色
Button AlphabetButton = new Button();
AlphabetButton.Background = new SolidColorBrush(Colors.Red);
Run Code Online (Sandbox Code Playgroud)
以这种方式而不是背景颜色我想为动态创建的按钮控件设置背景图像.这该怎么做 ?能否请您提供我可以解决上述问题的任何代码或链接.如果我做错了什么,请指导我.
c# ×7
silverlight ×5
linq-to-xml ×2
asp.net ×1
base64 ×1
button ×1
casting ×1
combobox ×1
dynamic ×1
installation ×1
listbox ×1
master-pages ×1
polymorphism ×1
shadowing ×1
sqlite ×1
stackpanel ×1
wpf ×1