Code hangs after Network Stream.Read

RedRascal

New Member
I am trying to connect to printer through my code and then applying security settings on the printer. Before applying the security feature it checks for password in the following code module. The code hangs after the linestream.Flush()\[code\]if (responseStr.IndexOf(PrinterSecurityConstants.NewPrinterPass) > 0){ LogUtility.Info(PrinterSecurityConstants.ValidateUserNamePassword); data = http://stackoverflow.com/questions/12808191/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);}\[/code\]What I need to do so that this code works.
 
Back
Top