我正在编写Win32控制台应用程序,它可以使用这样的可选参数启动:
app.exe /argName1:"argValue" /argName2:"argValue"
Run Code Online (Sandbox Code Playgroud)
我是否必须手动解析它(以便能够确定哪些参数存在)来自argc/argv变量,或者Win32 API是否包含一些参数解析器?
我已经下载了版本 1.21.6 的 nginx windows 映像(https://nginx.org/en/download.html),nginx -V输出包含--with-http_sub_module:
PS C:\Utils\nginx-1.21.6> .\nginx.exe -V
nginx version: nginx/1.21.6
built by cl 16.00.40219.01 for 80x86
built with OpenSSL 1.1.1m 14 Dec 2021
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre2-10.39 --with-zlib=objs.msvc8/lib/zlib-1.2.11 --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-openssl=objs.msvc8/lib/openssl-1.1.1m --with-openssl-opt='no-asm no-tests -D_WIN32_WINNT=0x0501' --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module
Run Code Online (Sandbox Code Playgroud)
不幸的是,我无法进行替换:(我试图在这里获得一些灵感: …
这是一个由netbeans Swing gui设计师生成的代码.我正在尝试执行以下操作:jLabel1并且jLabel2将仅包含尺寸为52x46像素而没有文本的图像图标,它们应该固定在该行的左侧和右侧,jTextField2预计将填充jlabels之间的间隙并自动调整为全屏/查看宽度.
问题是,jTextField2无论窗口/视图的大小是多少,都保持相同的宽度...初始宽度取决于字段内硬编码文本的长度...
你有什么想法,怎么做?
private void initComponents() {
javax.swing.JLabel jLabel1;
javax.swing.JLabel jLabel2;
javax.swing.JTextField jTextField2;
java.awt.GridBagConstraints gridBagConstraints;
jLabel1 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new java.awt.GridBagLayout());
jLabel1.setText("ABC");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
getContentPane().add(jLabel1, gridBagConstraints);
jTextField2.setText("some text field content");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
getContentPane().add(jTextField2, gridBagConstraints);
jLabel2.setText("ABC");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
getContentPane().add(jLabel2, gridBagConstraints);
pack(); …Run Code Online (Sandbox Code Playgroud) 我有一个基于GWT(谷歌网络工具包)和JPA(eclipselink 2.3)的应用程序.它没有使用GAE(应用程序引擎).
当我完成应用程序时,我在eclipse中运行'google-> gwt compile'菜单,然后将/ war内容上传到tomcat目录...
应用程序正在运行,但是当我尝试在gui中执行一个特定操作时,我收到一条错误消息,而Tomcat日志包含此异常:http://paste2.org/p/1879857(java.lang.NoClassDefFoundError)
在应用程序开发期间,我多次遇到这种异常,它总是由于war/WEB-INF/lib /中没有库.jar文件引起的......任何时候它都发生了,我将.jar存储到了文件夹,它工作...但不是这次...
这个类位于gwt-dev.jar(是的,它在那里 - 已经搜索了存档)并且它没有帮助我将存档存储到lib /文件夹...
它也包含在classpath中,并且编译器没有问题...编译完成没有错误(因此编译器可以看到该类).
你有什么想法,如何让tomcat看到这堂课?
谢谢
我对powershell脚本不是很熟悉,而且我遇到了这个问题:我需要对检索到的对象进行一些操作,如下所示:
$object = [ADSI]'LDAP://CN=Test User,OU=Dept,OU=Users,DC=example,DC=org'
...
$object.Commit()
Run Code Online (Sandbox Code Playgroud)
这工作正常,但我必须使用存储在变量中的专有名称 - 我的测试脚本看起来像这样,但它不起作用:
$object = [ADSI]'LDAP://$variable'
...
$object.Commit()
Run Code Online (Sandbox Code Playgroud)
第一次调用[ADSI]本身不会导致错误,但任何后续操作都会因消息崩溃:
The following exception occurred while retrieving member "commit": "The server is not operational.
"
At line:1 char:10
+ $object.commit <<<< ()
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember
Run Code Online (Sandbox Code Playgroud)
我很确定,参数是以某种错误的方式发送的,但我不知道,如何修复它,有人可以帮忙吗?
tahnks
c ×1
command-line ×1
gwt ×1
java ×1
java-ee ×1
nginx ×1
nginx-config ×1
powershell ×1
swing ×1
tomcat ×1
winapi ×1
windows ×1