小编hir*_*roo的帖子

iptables:如何删除postrouting规则?

我想删除下面的POSTROUTING规则,

[root@hostname ~]# service iptables status
Table: nat
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination         
1    MASQUERADE  all  --  192.168.1.0/24       0.0.0.0/0           

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         
Run Code Online (Sandbox Code Playgroud)

然后我输入下面,

[root@hostname ~]# iptables -D POSTROUTING 1
iptables: No chain/target/match by that name
Run Code Online (Sandbox Code Playgroud)

有什么不对的吗?

iptables

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

如何从BitmapImage创建WriteableBitmap?

我可以从Assets中的图片创建WriteableBitmap.

Uri imageUri1 = new Uri("ms-appx:///Assets/sample1.jpg");
WriteableBitmap writeableBmp = await new WriteableBitmap(1, 1).FromContent(imageUri1);
Run Code Online (Sandbox Code Playgroud)

但是,我无法从图片目录创建WriteableBitmap,(我正在使用 WinRT XAML工具包)

//open image
StorageFolder picturesFolder = KnownFolders.PicturesLibrary;
StorageFile file = await picturesFolder.GetFileAsync("sample2.jpg");
var stream = await file.OpenReadAsync();

//create bitmap
BitmapImage bitmap2 = new BitmapImage();
bitmap2.SetSource();
bitmap2.SetSource(stream);

//create WriteableBitmap, but cannot
WriteableBitmap writeableBmp3 = 
    await WriteableBitmapFromBitmapImageExtension.FromBitmapImage(bitmap2);
Run Code Online (Sandbox Code Playgroud)

它是否正确 ?

writeablebitmap c#-4.0 windows-8 windows-runtime

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