问题列表 - 第49846页

将数据从C#中的第二个表单传回第一个表单

我有两个表格.说FormA,FormB.

从FormA我使用frmB.Show()调用FormB ;

在FormB中,我有两个文本框和一个组合框控件.假设用户在这两个文本框中输入一些数据,并从Form2中的组合框中选择一个项目,然后单击确定按钮.

点击后我想要那些文本框用户输入的值,组合框选择项目值返回到FormA.

我如何使用C#实现这一目标.

c# c#-4.0

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

使用Xpath从SOAP Message获取价值

我试图从以下SOAP消息中获取值,但也许我在XPath上的语法不好

XPath我正在使用:

/soap:Body/n0:RequestSystemGuidResponse/SystemGuid
Run Code Online (Sandbox Code Playgroud)

错误:

Error processing xml. Namespace prefix 'n0' is not defined.

SOAP XML:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Header></soap-env:Header>
    <soap-env:Body>
        <n0:RequestSystemGuidResponse 
            xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
            <Errors></Errors>
            <SystemGuid>E050831C9CA1D1F1A9FC005056B95649</SystemGuid>
        </n0:RequestSystemGuidResponse>
    </soap-env:Body>
</soap-env:Envelope>
Run Code Online (Sandbox Code Playgroud)

xpath soap

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

如何在Python中可靠地处理Web数据

我正在使用以下代码从网站获取数据:

time_out = 4

def tryconnect(turl, timer=time_out, retries=10):
    urlopener = None
    sitefound = 1
    tried = 0
    while (sitefound != 0) and tried < retries:
        try:
            urlopener = urllib2.urlopen(turl, None, timer)
            sitefound = 0
        except urllib2.URLError:
            tried += 1
    if urlopener: return urlopener
    else: return None
Run Code Online (Sandbox Code Playgroud)

[...]

urlopener = tryconnect('www.example.com')
if not urlopener:
    return None
try:
    for line in urlopener:
        do stuff
except httplib.IncompleteRead:
    print 'incomplete'
    return None
except socket.timeout:
    print 'socket'
    return None
return stuff
Run Code Online (Sandbox Code Playgroud)

有没有办法我可以处理所有这些异常而不必每次都有这么多的样板代码?

谢谢!

python urllib2 urlopen web

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

Linux C++项目目录布局 - CMake

我想为我的linux c ++项目使用一些标准布局,该项目是使用cmake构建的,包含一些可执行文件和这些exec可能链接到的库.目前我只有一个项目文件夹和每个子项目的子文件夹.最高级别的CMakeLists和opt级别添加的每个子级别中的一个.

 Project-
            executable1
            executable2
            library
Run Code Online (Sandbox Code Playgroud)

但是我认为如下设置会更好

Project -
    lib //Library output folder
    bin //Executable output folder
    src //Al cpp source files
    include //All header files
    test //All tests
Run Code Online (Sandbox Code Playgroud)

我只有一个顶级的CMakeLists.我可以在cmake中轻松设置它.有没有人有理由选择不同的布局?

c++ linux cmake

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

VB .NET与VB 2010

我只是想知道VB.NET和VB 2010是否相同.

我是在想.

vb.net

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

更新自定义Android应用

我的客户希望Android应用程序在进行更改时自动更新.他们不想在Android市场上发布应用程序.这是第一次使用Android SDK或许多其他安装方式安装应用程序.

如果添加错误修复或功能,我如何确保自动升级应用程序.如果不是自动的,应用程序中的按钮也可以

谢谢.

android

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

获取Facebook的应用程序ID?

我如何获得Facebook的app_id?我需要使用它(http://developers.facebook.com/docs/reference/dialogs/feed/):

http://www.facebook.com/dialog/feed?
app_id=123050457758183&
link=http://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg&
name=Facebook%20Dialogs&
caption=Reference%20Documentation&
 description=Dialogs%20provide%20a%20simple,%20consistent%20interface%20for%20applications%20to%20interact%20with%20users.&
message=Facebook%20Dialogs%20are%20so%20easy!&
redirect_uri=http://www.example.com/response
Run Code Online (Sandbox Code Playgroud)

将一些内容发布到用户墙...但我无法找到我注册的地方以获取app_id.有任何想法吗?

facebook

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

具有接口/类的公共静态内部类的优点是什么?

在浏览项目的第三方库的某些来源时,我注意到以下代码模式:

public interface MyInterface {
    public static class MyClass1 implements MyInterface { ... }
    public static class MyClass2 implements MyInterface { ... }
    public static class MyClass3 implements MyInterface { ... }
}
Run Code Online (Sandbox Code Playgroud)

或者这一个:

public class MyBaseClass {
    public static class MyClass1 extends MyBaseClass { ... }
    public static class MyClass2 extends MyBaseClass { ... }
    public static class MyClass3 extends MyBaseClass { ... }
}
Run Code Online (Sandbox Code Playgroud)

真人生活的例子:

  • SwingX: org.jdesktop.swingx.decorator.HighlightPredicate(来源)
  • 物质:org.pushingpixels.substance.api.renderers.SubstanceDefaultTableCellRenderer (来源)

拥有这样的代码结构有什么好处?

我的第一个想法是"聚合",但使用普通的旧包可以实现同样的目的.那么什么时候/为什么使用公共内部类而不是包更好?

java

35
推荐指数
2
解决办法
2918
查看次数

链接到Gmail中的个别邮件

我想在gmail帐户中下载所有电子邮件,并且还希望获得唯一的URL,它将在gmail中打开确切的邮件,当然还有身份验证.我尝试使用javax.mail imap库,但Imap可能不支持类似的东西.

我可以使用"https://mail.google.com/mail/feed/atom"gmail供稿.但不会给我整个电子邮件,它只提供未读的电子邮件,我不想错过任何电子邮件

gmail web-crawler javax.mail gmail-imap

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

用于Adobe Air应用程序的openFileDialog

我有一个桌面Adobe Air应用程序.我想将openFileDialog添加到我的应用程序,以询问用户他的项目的路径.不幸的是,我无法使用FileReference - 它只返回文件名,而不是路径.

    private function selectHandler(event:Event):void {
       var file:FileReference = FileReference(event.target);
       trace("selectHandler: name=" + file.name); //only name!
    }
Run Code Online (Sandbox Code Playgroud)

有没有办法在这样的应用程序中应用openFileDialog并获取用户选择的文件路径?

air openfiledialog actionscript-3 filepath

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