对不起,如果这很难理解,第一次尝试C#.
我试图在连接到服务器的客户端之间进行简单的公共"聊天".我已经尝试将整数传递给服务器并打印出来,一切都很好,但是,当我切换到字符串时,它似乎只能传递1个字符(因为ns.Write(converted, 0, 1);).如果我ns.Write(converted,0,10)在输入少于10个字符的消息时将ns.Write增加到一切崩溃(客户端和服务器).
服务器代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net.Sockets;
namespace MultiServeris
{
class Multiserveris
{
static void Main(string[] args)
{
TcpListener ServerSocket = new TcpListener(1000);
ServerSocket.Start();
Console.WriteLine("Server started");
while (true)
{
TcpClient clientSocket = ServerSocket.AcceptTcpClient();
handleClient client = new handleClient();
client.startClient(clientSocket);
}
}
}
public class handleClient
{
TcpClient clientSocket;
public void startClient(TcpClient inClientSocket)
{
this.clientSocket = inClientSocket;
Thread ctThread = new Thread(Chat);
ctThread.Start();
}
private void Chat() …Run Code Online (Sandbox Code Playgroud) 如何让'before'三角形继承正方形的颜色?Color:inherit,border-color:inherit,background-color:inherit没有发挥出来.
HTML:
<div class="tag">
16,00 €
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.tag{
position:absolute;
top:20px;
left:150px;
display:block;
width:290px;
height:100px;
background-color: orange;
border-color: orange;
}
.tag:before{
color:orange;
content:"";
position:absolute;
left:-50px;
border-top: 50px solid transparent;
border-right: 50px solid;
border-bottom: 50px solid transparent;
}
Run Code Online (Sandbox Code Playgroud)