我有以下代码:
private static bool IsTextAllowed(string text)
{
Regex regex = new Regex("[^0-9]+"); // Regex that matches disallowed text
return !regex.IsMatch(text);
}
private void TextboxClientID_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
e.Handled = !IsTextAllowed(e.Text);
}
Run Code Online (Sandbox Code Playgroud)
这允许在文本框中使用空格,如何也防止插入空格?
我知道以下问题可能需要您投入比其他问题更多的时间来修复它,但如果您感兴趣,请这样做。它可能对你也有用:)
我试图配置一个很好的“应用程序”,名为iface. 它允许在 Windows 的命令提示符下使用 Linux VM 的终端。像这样:
这些脚本在这里:https://github.com/gynvael/iface 有如何配置它详细的视频指令(波兰,但你可以从视频本身的理解)在这里。
无论如何,当尝试gnome-terminal使用我的(非 root 用户)Linux 用户运行命令时 - 我遇到以下错误:
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached
但是,当尝试使用sudo gnome-terminal或使用 root 用户运行它时(如视频中的 1:52:30 分钟) - 它可以工作并打开命令提示符。
实际上,该命令(在 Windows 中)if-l-cmd.py /(如您在 1:56:09 分钟中看到的)起作用了,但是在我重新启动计算机后 - 它不再起作用了。我试图从一开始就在另一台计算机上安装所有内容,但遇到了同样的问题。
帮助将不胜感激!
当我使用 Windows 7 时,以下批处理命令打开了 MobaXterm,并在内部打开了一个连接到 VM(“linux-server”)的新选项卡(除了主页选项卡):
start "" "C:\Program Files (x86)\MobaXterm\MobaXterm.exe" -newtab linux-server
Run Code Online (Sandbox Code Playgroud)
现在,在 Windows 10 中,该命令无法正常工作。它会打开 MobaXterm,但不会打开与虚拟机的会话。
我尝试从命令行运行该命令,结果是一样的。
我的要求是:
提前致谢!
你好.在上图中,您可以看到后退箭头和(部分)标题.我使用附加的.xml代码更改了标题颜色.但是我想把后箭头变成白色.
我在网上看了一些答案,但对于这么简单的问题,它们看起来太复杂了.
这有什么简单的原因吗?
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="fill_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:titleTextColor="@android:color/white"/>Run Code Online (Sandbox Code Playgroud)
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
//...
public class LoginActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
//...
}
//...
}Run Code Online (Sandbox Code Playgroud)
android android-appcompat material-design android-toolbar android-support-design
我需要创建一个批处理文件,只有在计算机名称包含某些字符串时才会在Active Directory中移动计算机名称对象,例如:
If %computername% contains "LAP"
( dsmove "CN=%computername%,CN=Computers,DC=domain,DC=local" -newparent"OU=**Laptops**,OU=Computers,OU=Company,DC=domain,DC=local" )
If %computername% contains "DESK"
(dsmove "CN=%computername%,CN=Computers,DC=domain,DC=local" -newparent "OU=**Desktops**,OU=Computers,OU=Company,DC=domain,DC=local" )
Run Code Online (Sandbox Code Playgroud)
请问正确的命令是什么?
我iptables使用 . 将包添加到我的设备映像中CORE_IMAGE_EXTRA_INSTALL += "iptables"。
我尝试在设备上运行它并收到以下错误消息:
modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.9.11-1.0.0+gc27010d
iptables v1.6.1: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Run Code Online (Sandbox Code Playgroud)
好像我缺少内核模块。
需要您的帮助来将标准内核模块添加到映像中(在哪里可以找到所有模块文件以及如何将其添加并加载到映像中)。
android ×2
batch-file ×2
c# ×1
contains ×1
if-statement ×1
python ×1
regex ×1
session ×1
toolbar ×1
whitespace ×1
yocto ×1