asp.net-mvc – 有条件地在webgrid中显示图像 – mvc 3

asp.net-mvc – 有条件地在webgrid中显示图像 – mvc 3

在我的网格网格中,我需要根据值显示图像.代码如下 @model TraktorumMVC.Models.ManagePhotos@{ ViewBag.Title = ManagePhotos; Layout = ~/Views/Shared/_Layout.cshtml; var grid = new WebGrid(Model.AdPhotos);}

为什么有条件地包含direct.h或sys / stat.h基于_WIN32或__linux__?

为什么有条件地包含direct.h或sys / stat.h基于_WIN32或__linux__?

以下代码将做什么?为什么用它? #ifdef _WIN32 #include direct.h #elif defined __linux__ #include sys/stat.h #endif C中没有可移植的方式来操作文件系统目录.您需要一些提供包装器接口来操作目录的库. (使用系统调用,OS中断例程等) direct.h是Windows的C