小编Mor*_*der的帖子

进度条前景色

有谁知道如何更改WPF-Progressbar的前景色.它似乎总是与绿色合并.

c# wpf progress-bar

23
推荐指数
3
解决办法
4万
查看次数

WPF:将虚拟文件拖放到Windows资源管理器中

我正在开发一个类似于dropbox的应用程序,我在WPF列表视图中显示远程文件.我想拖动这些元素并将其放入Windows资源管理器中.我见过这样的代码:

var dataObject = new DataObject(DataFormats.FileDrop, files.ToArray());
dataObject.SetData(DataFormats.StringFormat, dataObject);
DoDragDrop(dataObject, DragDropEffects.Copy);
Run Code Online (Sandbox Code Playgroud)

但是你可能认为,那些文件还没有在本地系统上,在复制它们之前我需要连接到服务器,下载并解压缩文件.像ftp客户端一样.

我不知道怎么做,但我想知道是否有任何"掉落"事件或类似我能处理.

谢谢!

c# wpf drag-and-drop

8
推荐指数
1
解决办法
5429
查看次数

使用C#和.Net连接到远程队列管理器

我编写了一个使用此函数调用连接到本地队列管理器的应用程序:

MQQueueManager mqQMgr = new MQQueueManager("QM_QueueManagerName");
Run Code Online (Sandbox Code Playgroud)

现在我需要连接到另一台计算机上的远程队列管理器.

我可以使用MQ Explorer从我的开发PC使用QM_ComputerName队列管理器名称,S_ComputerName通道和ComputerName作为连接名称成功连接到远程队列管理器.所以可以从我的桌面访问它.

但是,当我尝试通过.Net连接时,MQRC_Q_MGR_NAME_ERROR无论我尝试什么,我都会得到.

我试过指定

MQEnvironment.Hostname = "ComputerName";
MQEnvironment.Channel = "S_ComputerName ";

and then calling

mqQMgr = new MQQueueManager("QM_ComputerName");

I also tried  calling 

mqQMgr = new MQQueueManager("QM_ComputerName", "S_ComputerName", "ComputerName");
Run Code Online (Sandbox Code Playgroud)

我在两种情况下都会出错.

有人可以提供建议吗?

c# ibm-mq

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

如何解决:由于意外的数据包格式,握手失败?

我正在从 Windows Server 2008 R2 连接到运行 vsFTPd 2.0.7 的 Linux FTP 服务器。我通过 SSL 连接。

这是它失败的代码行:

sslStream = new SslStream(stream, false, CertificateValidation);
Run Code Online (Sandbox Code Playgroud)

这是日志:

220 (vsFTPd 2.0.7)
AUTH SSL
234 Proceed with negotiation.
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

System.IO.IOException: The handshake failed due to an unexpected packet format.
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at KellermanSoftware.NetFtpLibrary.ProxySocket.InitSsl()
   at KellermanSoftware.NetFtpLibrary.FTP.Connect(Boolean implicitConnection)
Run Code Online (Sandbox Code Playgroud)

ftp

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

使用.NET SslStream的FTPS服务器

我正在用C#开发一个FTP服务器,我刚刚使用SslStream类完成了FTPS显式模式功能,一切都很顺利.

我在使用fileZilla> 3.0.11作为客户端时遇到问题.我google arround,似乎sslstream实现没有正确关闭连接.(不发送close_notify警报).使用WinScp,SmartFTP和lftp everithing工作正常.

任何想法或任何其他SSL库?

或者也许某种方式硬编码close_notify警报并发送它?

具体的代码示例会很棒!

创建sslStream:

_sslStream = new SslStream(socket.GetStream());      
var _cert = new X509Certificate2(certPath,pass);    
_sslStream.AuthenticateAsServer(_cert);
Run Code Online (Sandbox Code Playgroud)

关闭连接:

_sslStream.Close();
socket.Close();
_sslStream = null;
socket = null;
Run Code Online (Sandbox Code Playgroud)

FileZilla 3.6.0.2错误日志:

Response:   150 Opening data connection for LIST
Trace:  CFtpControlSocket::TransferParseResponse()
Trace:    code = 1
Trace:    state = 4
Trace:  CFtpControlSocket::SendNextCommand()
Trace:  CFtpControlSocket::TransferSend()
Trace:    state = 5
Trace:  CTlsSocket::OnRead()
Trace:  CTlsSocket::ContinueHandshake()
Trace:  TLS Handshake successful
Trace:  TLS Session resumed
Trace:  Cipher: AES-128-CBC, MAC: SHA1 …
Run Code Online (Sandbox Code Playgroud)

.net c# ssl ftps

5
推荐指数
1
解决办法
2205
查看次数

Bad notification posted Fatal Exception: android.app.RemoteServiceException:

 Fatal Exception: android.app.RemoteServiceException: Bad notification posted  Fatal Exception: android.app.RemoteServiceException: Bad notification posted from package com.noti: Couldn't update icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com.noti id=0x00000000) visible user=0 )

    Notification.Builder mBuilder = new Notification.Builder(context);

            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
                mBuilder.setSmallIcon(convertStringToBitmap(StringUtils.appendDegree("12")));
            } else {
                mBuilder.setSmallIcon(R.drawable.notification_icon);
            }

            // Creates an explicit intent for an Activity
            Intent resultIntent = new Intent(context, HomeActivity.class);
            resultIntent.putExtra(AppConstants.IS_ONGOING, true);
            resultIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
            PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent, 0);
            mBuilder.setContentIntent(resultPendingIntent);

            Notification notification =mBuilder.build();

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                if (getComplexNotificationView(context) != null) {
                    notification.contentView = …
Run Code Online (Sandbox Code Playgroud)

java android

5
推荐指数
0
解决办法
326
查看次数

matlab中的矩阵矩阵

我需要建立矩阵矩阵.说,$1\leq i,j\leq n$我必须定义一个矩阵$p_{ij}$,它将是一个矩阵$n\times n$.我能做什么-这是建立一个矩阵$P$$n^2\times n^2$-但$n=20$没有有关内存出错.

你能告诉我如何解决这个问题吗?

matlab

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

Jenkins tomcat7 部署错误

我有一个名为 'SampleMavenDeploy1' 的 jenkins 作业,它将工件(war 文件,pom.xml)从上游项目('SampleMavenBuild1')成功复制到该项目。

我对这个项目有以下配置:

构建步骤:

Copy artifacts from another project
    Project Name:SampleMavenBuild1
Run Code Online (Sandbox Code Playgroud)

构建后操作:

War/Ear files:MavenWebAppV14/target/*.war

Context Path:webapps

Containers:
    Tomcat7.x
        Manager username:tomcat
        Manager Password:tomcat
        Tomcat Url:http://localhost:8080/manager/text
Run Code Online (Sandbox Code Playgroud)

SampleMavenBuild1(make war file of a maven project)构建成功。在此作业 (SampleMavenDeploy1) 的工作区中,有一个战争文件 (MavenWebAppV14/target/MavenWebAppV14.war)。我还配置了 tomcat-users.xml 以添加用户名 'tomcat' 、密码 'tomcat' 和角色为 'manager-gui' 和 'manager-script' 的用户。

我在 jenkins 构建作业时遇到以下错误。此作业旨在通过 CI 服务器在 tomcat7 上部署 war 文件。我还在 jenkins 中安装了“部署到 tomcat”插件。

由用户 vikas 启动

Building in workspace C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace
Copied 2 artifacts from "SampleMavenBuild1" build number 4
Deploying C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war to …
Run Code Online (Sandbox Code Playgroud)

tomcat maven jenkins

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

Ninject 3.0中基于约定的绑定

我正在尝试在我的新项目上设置Ninject,我想使用对流来扫描组件

IFoo
Run Code Online (Sandbox Code Playgroud)

将自动解决

IBar
Run Code Online (Sandbox Code Playgroud)

所有样本和文档都描述了使用这种方法

kernel.Scan(...)
Run Code Online (Sandbox Code Playgroud)

虽然Ninject 3 Kernel似乎使用了.Load.如果我使用Load进行扫描,那么如何使用约定配置扫描?

编辑

我能够使用它来运行:https://github.com/ninject/ninject.extensions.conventions/wiki/What-is-configuration-by-convention

但是,现在我无法加载我的模块.我正在使用下面的代码并得到以下错误.

    IKernel kernel = new StandardKernel();
    kernel.Bind(x => x
        .FromAssembliesMatching("Crt.*.dll")
        .SelectAllTypes()
        .BindAllInterfaces()
        );
    kernel.Load("*.dll");
    return kernel;
Run Code Online (Sandbox Code Playgroud)

错误:

Ninject.ActivationException was unhandled
  Message=Error activating ITrainingEngine
More than one matching bindings are available.
Activation path:
  1) Request for ITrainingEngine

Suggestions:
  1) Ensure that you have defined a binding for ITrainingEngine only once.

  Source=Ninject
  StackTrace:
       at Ninject.KernelBase.Resolve(IRequest request) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 380
       at Ninject.ResolutionExtensions.GetResolutionIterator(IResolutionRoot root, Type service, Func`2 constraint, IEnumerable`1 parameters, …
Run Code Online (Sandbox Code Playgroud)

conventions ninject-3

3
推荐指数
1
解决办法
2118
查看次数

SNMP - 在一次通话中获取完整的Mac表

对于我的项目,我需要从交换机下载mac表,并尽可能快地完成.官方解决方案有点慢.它需要获得所有的Vlan的名单,并为snmpwalk的与每一个触发单独调用OID=.1.3.6.1.2.1.17.4.3.1.1和团体字符串索引与VLAN号.这可能需要很长时间,因为我们的交换机上的vlan数量范围是十.有没有办法从mac表中获取所有mac地址(一些特殊的社区索引代表所有可用的vlan索引)?提前致谢..

mac-address snmp

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

Oracle:在函数中返回多行

我正在尝试创建一个返回多行的函数。

以下是我的功能和类型

create or replace type emp_type
(
first_name varchar2(20)
, last_name varchar2(20)
, depart_name varchar2(20)
)
/
create or replace function get_employee
 (loc in number)
return emp_type
as  
   emp_record emp_type;
begin
    select a.first_name, a.last_name, b.department_name into emp_record.first_name,
emp_record.last_name,emp_record.depart_name 
   from employees a, departments b 
    where a.department_id=b.department_id and location_id=loc;

   return(emp_record);  
end;
Run Code Online (Sandbox Code Playgroud)

我用过

select get_employee(5) from dual;
Run Code Online (Sandbox Code Playgroud)

我收到“ exact fetch returns more than requested number of rows”错误。后来当我rownum<2在选择查询中使用时,我得到了“ Reference to uninitialized composite”。

能否请你帮忙?

提前致谢

oracle stored-functions oracle11g

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

基于 tcp 端口匹配 TCP 流 Ryu 控制器

我正在尝试使用带有 RYU SDN 控制器的 tcp 源端口将 TCP 流重定向到特定服务器。这是我的拓扑(第一步很简单):

host -- ovs1 -- ovs2 -- server
Run Code Online (Sandbox Code Playgroud)

ovs1的匹配规则:

match = parse.OFPMatch(in_port=port,eth_type=0x0800, ipv4_dst=server_ip, tcp_src=tcp_pkt.src_port)
Run Code Online (Sandbox Code Playgroud)

但我收到以下错误

EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0x370bf1bf
 `-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x4, code=0x9, data=b'\x04\x0e\x00\x70\x37\x0b\xf1\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x28\x80\x00\x00\x04\x00\x00\x00\x01\x80\x00\x0a\x02')
 |-- type: OFPET_BAD_MATCH(4)
 |-- code: OFPBMC_BAD_PREREQ(9)
 `-- data: version=0x4, msg_type=0xe, msg_len=0x70, xid=0x370bf1bf
     `-- msg_type: OFPT_FLOW_MOD(14)
Run Code Online (Sandbox Code Playgroud)

关键是,如果我删除 tcp_src 选项,一切正常,这就是为什么我认为问题与我传递端口的方式有关。

有任何想法吗?

提前致谢!

tcp openflow openvswitch sdn ryu

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

量角器错误 - 试图很好地关闭 selenium

我无法执行量角器测试。无论我在启动 webdriver 后输入什么,它都会显示“试图很好地关闭”。

     Jameson Hill@DESKTOP-GP6CRIB MINGW64 ~/desktop/test-protractor
$ webdriver-manager start
[11:34:27] I/start - java -Dwebdriver.chrome.driver=C:\Users\Jameson Hill\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.29.exe -Dwebdriver.gecko.driver=C:\Users\Jameson Hill\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\geckodriver-v0.15.0.exe -jar C:\Users\Jameson Hill\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.3.1.jar -port 4444
[11:34:27] I/start - seleniumProcess.pid: 7092
11:34:27.859 INFO - Selenium build info: version: '3.3.1', revision: '5234b32'
11:34:27.859 INFO - Launching a standalone Selenium Server
2017-04-19 11:34:27.874:INFO::main: Logging initialized @212ms to org.seleniumhq.jetty9.util.log.StdErrLog
11:34:27.937 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:34:27.937 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
Unable to create new instances on this machine.
11:34:27.937 INFO …
Run Code Online (Sandbox Code Playgroud)

jasmine protractor angular

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