我在 C# 项目中有一个 HTTPSystemDefinitions.cs 文件,它基本上描述了旧的 Windows ISAPI 以供托管代码使用。
这包括与 ISAPI 相关的完整结构集,而不是全部或由代码使用。在编译时,这些结构的所有字段成员都会导致如下警告:-
警告字段“UnionSquare.ISAPI.HTTP_FILTER_PREPROC_HEADERS.SetHeader”从未分配给,并且始终具有其默认值 null
或者
警告从未使用过“UnionSquare.ISAPI.HTTP_FILTER_PREPROC_HEADERS.HttpStatus”字段
这些可以被禁用#pragma warning disable
吗?如果是这样,相应的错误编号是多少?如果没有,我还能做些什么吗?请记住,我只对此文件执行此操作,重要的是我会看到来自其他文件的此类警告。
编辑
示例结构:-
struct HTTP_FILTER_PREPROC_HEADERS
{
//
// For SF_NOTIFY_PREPROC_HEADERS, retrieves the specified header value.
// Header names should include the trailing ':'. The special values
// 'method', 'url' and 'version' can be used to retrieve the individual
// portions of the request line
//
internal GetHeaderDelegate GetHeader;
internal SetHeaderDelegate SetHeader;
internal AddHeaderDelegate AddHeader;
UInt32 HttpStatus; // New in 4.0, status for SEND_RESPONSE
UInt32 dwReserved; // New in 4.0
}