小编Dav*_*yes的帖子

如何通过SFTP从服务器检索文件?

我正在尝试使用Java使用SFTP(而不是FTPS)从服务器检索文件.我怎样才能做到这一点?

java security ftp sftp

223
推荐指数
9
解决办法
36万
查看次数

读/写'扩展'文件属性(C#)

我试图找出如何读取/写入C#中的扩展文件属性,例如,您可以在Windows资源管理器中看到的注释,比特率,访问日期,类别等.任何想法如何做到这一点?编辑:我主要是读/写视频文件(AVI/DIVX/...)

c# extended-properties

100
推荐指数
8
解决办法
10万
查看次数

C#等到条件成立

我正在尝试编写在满足条件时执行的代码.目前,我正在使用while ...循环,我知道效率不高.我也在看AutoResetEvent(),但我不知道如何实现它,以便它一直检查,直到条件为真.

代码也恰好存在于异步方法中,所以可能某种等待可以工作吗?

private async void btnOk_Click(object sender, EventArgs e)
{
        // Do some work
        Task<string> task = Task.Run(() => GreatBigMethod());
        string GreatBigMethod = await task;

        // Wait until condition is false
        while (!isExcelInteractive())
        {
            Console.WriteLine("Excel is busy");
        }

        // Do work
        Console.WriteLine("YAY");
 }


    private bool isExcelInteractive()
    {
        try
        {
            Globals.ThisWorkbook.Application.Interactive = Globals.ThisWorkbook.Application.Interactive;
            return true; // Excel is free
        }
        catch
        {
            return false; // Excel will throw an exception, meaning its busy
        }
    }
Run Code Online (Sandbox Code Playgroud)

我需要找到一种方法来保持检查,isExcelInteractive()而不会在循环中卡住CPU.

注意:Excel中没有事件处理程序在未处于编辑模式时引发.

c# loops

25
推荐指数
4
解决办法
8万
查看次数

TeamCity构建和部署:如何将依赖工件路径传递给脚本?

如何将工件路径传递给TeamCity中的脚本.情景是这样的

  1. 建设项目
  2. 部署项目(具有工件依赖性到#1)

第2步由一个脚本组成

  1. 停止服务(解锁文件)
  2. 将构建工件复制到服务器
  3. 重新启动服务

我正在努力完成第2步,我想我需要将构建工件的路径传递到脚本中,但我看不出你是怎么做到的?

deployment build-automation teamcity teamcity-7.0

18
推荐指数
1
解决办法
1万
查看次数

XmlSerialization和xsi:SchemaLocation(xsd.exe)

我使用xsd.exe生成一个C#类来读/写GPX文件.如何获得生成的XML文件以包含xsi:schemaLocation属性,例如.

我想要以下但是xsi:schemaLocation总是丢失

<?xml version="1.0"?>
<gpx 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    version="1.1" 
    xmlns="http://www.topografix.com/GPX/1/1"
    creator="ExpertGPS 1.1 - http://www.topografix.com"
    xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
</gpx>
Run Code Online (Sandbox Code Playgroud)

c# xsd xml-serialization xsd.exe gpx

13
推荐指数
1
解决办法
1万
查看次数

Windows Phone 7:套接字编程

Windows Phone 7中是否支持TCP/IP套接字?到目前为止我找不到任何运气.
我想连接到服务器上的端口并发出命令/接收响应

sockets windows-phone-7

13
推荐指数
2
解决办法
1万
查看次数

你如何签署Java Midlet?

一个简单的问题,答案相当复杂:

如何签署Java Midlet,以便将其加载到安全提示较少的手机上?

java midlet sign

12
推荐指数
1
解决办法
2万
查看次数

Windows Phone 7:突出显示"选定列表框"项

我有以下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)

silverlight listbox silverlight-4.0 windows-phone-7

12
推荐指数
1
解决办法
2万
查看次数

Azure推送通知无法发送时会发生什么?

是否有任何关于失败时NotificationOutcome类状态的文档?

NotificationOutcome result = await _hub.SendNotificationAsync(azureNotification, tags);
Run Code Online (Sandbox Code Playgroud)

MSDN文档是相当(完全)没用.

我猜测非零result.Failureresult.Success意味着出现问题(成功时似乎都是0)result.State可能更有用但是似乎没有太多关于此的文档

c# azure-notificationhub

12
推荐指数
1
解决办法
2329
查看次数

点击并按住(长按)

有人在Windows Phone 7应用程序中实现了Tap&Hold吗?我可以看到几个可能的方法KeyDown/KeyUp和一个计时器或ManipulationStarted/manipulationCompleted和一个计时器.
然而,这让我觉得这不是一个想法,因为不同的应用程序会有不同的计时器设置导致不一致.
我错过了什么吗?我希望有一个TapAndHold活动

tapandhold windows-phone-7 long-press

10
推荐指数
2
解决办法
8680
查看次数