silverlight

Silverlight 实现下载文件功能!

北城以北 提交于 2019-12-24 17:56:54
最近一直在做Siverlight的有关的项目,今天做了一个下载功能,也是经过网上找的各种办法才得到以下的结果,我来总结一下。如果哪有不对的或者哪块有错误的还请各位进行指出来!谢谢! 在sl中的下载,我认为很难做到像c#中的下载。可以弹出一个对话框进行保存或者另存为的样子。 下面是通过:WebClientDownHandler文件进行的! using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; namespace E9.Server { /// <summary> /// Summary description for WebClientDownHandler /// </summary> public class WebClientDownHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { String fileName = context.Request.QueryString["fileName"]; //客户端保存的文件名 fileName=HttpUtility.UrlDecode(fileName); String

Service reference: Custom Tool warning: Cannot import wsdl:portType

☆樱花仙子☆ 提交于 2019-12-24 17:53:05
问题 This is in relation to my previous question, which I think might be caused by this problem. I added a new service to add a varbinary to my database table: Afbeeldingen id:int afbeelding1:varbinary(max) I made the service contract like this: [OperationContract] public void setAfbeelding(Afbeelding a) { dc.Afbeeldings.InsertOnSubmit(a); dc.SubmitChanges(); } I compiled the project, added the service reference to my main project and then I get the following errors: Custom tool warning: Unable to

Service reference: Custom Tool warning: Cannot import wsdl:portType

我的未来我决定 提交于 2019-12-24 17:53:02
问题 This is in relation to my previous question, which I think might be caused by this problem. I added a new service to add a varbinary to my database table: Afbeeldingen id:int afbeelding1:varbinary(max) I made the service contract like this: [OperationContract] public void setAfbeelding(Afbeelding a) { dc.Afbeeldings.InsertOnSubmit(a); dc.SubmitChanges(); } I compiled the project, added the service reference to my main project and then I get the following errors: Custom tool warning: Unable to

Silverlight controls in ASP.NET application

a 夏天 提交于 2019-12-24 17:29:12
问题 I need my ASP.NET web application to use silverlight controls in my web page. Please let me know how to use them. Do i need to add any reference for them in my Visual Studio 2005. Framework 2.0 and ASP.NET 2.0 application environment. 回答1: A nice post over here which takes care of your problem. Cheers. 来源: https://stackoverflow.com/questions/143281/silverlight-controls-in-asp-net-application

Silverlight: How to bind to parent view's DataContext?

我怕爱的太早我们不能终老 提交于 2019-12-24 16:12:00
问题 I have a ParentView that contains a childView <UserControl ... x:Name="MyParentView"> <Grid> <sdk:TabControl Name="ContactTabControl"> <sdk:TabItem Header="Contact" Name="CustomerTabItem"> <Grid> <Views:CustomerView/> </Grid> </sdk:TabItem> </sdk:TabControl> </Grid> </UserControl> Within my CustomerView I would like to bind the Firstname textbox to Parent's DataContext. I have tried this inside the CustomerView: <TextBox Text={Binding ElementName=MyParentView, Path=DataContext.Firstname} /> I

In Silverlight 5, how to get Directory name of a file without Running application Out Of Browser?

我只是一个虾纸丫 提交于 2019-12-24 15:51:43
问题 In Silverlight 5, I am performing File operations using Open File Dialog. I want to read the Directory Name of the selected file from the Open File Dialog box. But I am getting error "File operation not permitted. Access to path '' is denied." How to solve this issue ? It is working fine when I opt for "Running application Out Of Browser with elevated trust". But I don't want to run my app outside of the browser. So my problem is to get the Directory name of the selected file without making

how to specify all ports in client access policy file - silverlight

徘徊边缘 提交于 2019-12-24 15:49:36
问题 How do I specify a wildcard '*' for the ports in a client access policy file? If I want to specify multiple ports in the following file is there anyway to do this using a wildcard instead of explicitly listing each server: <?xml version="1.0" encoding="utf-8"?> <access-policy> <cross-domain-access> <policy> <allow-from http-request-headers="*"> <domain uri="http://*.foobar.net:81" /> <domain uri="http://*.foobar.net:82" /> <domain uri="http://*.foobar.net:83" /> <domain uri="http://*.foobar

Silverlight printing busy\progress bar

喜夏-厌秋 提交于 2019-12-24 15:48:20
问题 I'm using Silverlight 4 to print but I would like some sort of progress bar or busy indicator. I've tried to using a progress bar but it is not really working. The 2 issues I have are: the progress bar does not indicate progress, I have IsIndeterminate=True, but it does not animate when printing starts (Print dialog's Print button is clicked) the progress bar visibility is not being set at the proper time, depending upon where I put the code to set visibility it displays either too soon

How to Text wrap and add … at the end

不想你离开。 提交于 2019-12-24 15:38:32
问题 Lets say you have this text "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna." put in a textblock with TextWrapping="Wrap", the textblock only supports 2 lines, so how do I add the usual "..." at the end of the text so as to say there is more to read 回答1: This is not trivial to answer for use in SilverLight because you cannot use native

How to link to a specific system-setting in your Windows Phone app?

﹥>﹥吖頭↗ 提交于 2019-12-24 15:31:05
问题 I was wondering if it would be possible to hook a button up to a specific setting.. For example: 1. User starts app that uses GPS. 2. The GPS is turned off. A messagebox appears with a message saying that the GPS is turned off and a button. 3. The user taps on the button, and the "location settings" is being launched. 4. The user can switch on the GPS, and goes back to the app. This would be a more convenient way to change settings, and it saves the user some time. I think I saw it in an app,