我搜索了很多,但互联网上的所有例子都是控制台应用程序.我已经尝试使用控制台应用程序示例的Windows窗体,但当我调用socket.start窗体冻结和状态更改为(不响应).我也尝试了多个线程,但它也不成功.如果有可能请告诉我一些事情.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace mserver1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ServerClass sc = new ServerClass();
sc.startServer(textBox1, richTextBox1);
}
}
public class ServerClass
{
public void startServer(TextBox tb, RichTextBox rb)
{
IPEndPoint ip = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9939);
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(ip);
socket.Listen(20); …Run Code Online (Sandbox Code Playgroud) DB是MySQL.有一个表格,结构如下所示:
select * from table1
id column1
-- --------
1 3,4,5
2 3,7,8
Run Code Online (Sandbox Code Playgroud)
并且sql无法正常工作:
SELECT * FROM table1 WHERE 3 in (column1)
Run Code Online (Sandbox Code Playgroud)
我知道桌子的结构不对.但它在我面前完成.你能以这种方式向我推荐什么?或者会执行此sql含义的东西?谢谢.
我想将Internationalization添加到我的Spring MVC应用程序中.我知道这可能是一个复制问题,但我已经尝试了stackoverflow和谷歌的所有解决方案,但仍然无法正常工作.我会详细解释一下.这是
web.xml中
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
根的context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<!-- Localization Start -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="defaultEncoding" value="UTF-8"/>
<property name="basenames">
<list>
<value>/WEB-INF/messages</value>
</list>
</property>
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="tr" />
</bean>
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
<!-- Localization End -->
</beans>
Run Code Online (Sandbox Code Playgroud)
我有messages_en.properties和messages_tr.properties文件.它们工作正常,因为当我将defaultLocale更改为en或tr时,我从属性文件中获得了真正的标签.但问题是,当我从浏览器尝试时?lang=tr or …