コードを使用してプリンターに接続し、プリンターにセキュリティ設定を適用しようとしています。セキュリティ機能を適用する前に、次のコードモジュールでパスワードをチェックします。行の後にコードがハングする
stream.Flush()
if (responseStr.IndexOf(PrinterSecurityConstants.NewPrinterPass) > 0)
{
LogUtility.Info(PrinterSecurityConstants.ValidateUserNamePassword);
data = System.Text.Encoding.ASCII.GetBytes(
ConfigurationManager.AppSettings[PrinterSecurityConstants.CurrentPass]
.ToLower() + CommonConstant.Carriagereturn);
stream.Write(data, 0, data.Length);
stream.Flush();
bytes = stream.Read(dataResponse, 0, dataResponse.Length);
responseStr = System.Text.Encoding.ASCII.GetString(dataResponse, 0, bytes);
}
このコードが機能するために私がする必要があること。