Click here to Skip to main content
15,890,690 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
AnswerRe: HELP SOLVE THIS COM PORT QUESTION Pin
Roger Wright11-Mar-09 20:07
professionalRoger Wright11-Mar-09 20:07 
GeneralRe: HELP SOLVE THIS COM PORT QUESTION Pin
Mr. Noatak12-Mar-09 9:09
Mr. Noatak12-Mar-09 9:09 
GeneralRe: HELP SOLVE THIS COM PORT QUESTION Pin
Roger Wright20-Mar-09 21:49
professionalRoger Wright20-Mar-09 21:49 
GeneralRe: HELP SOLVE THIS COM PORT QUESTION-question for Roger W. or others Pin
Mr. Noatak6-Apr-09 9:47
Mr. Noatak6-Apr-09 9:47 
GeneralRe: HELP SOLVE THIS COM PORT QUESTION-question for Roger W. or others Pin
Roger Wright6-Apr-09 13:54
professionalRoger Wright6-Apr-09 13:54 
QuestionEdit the PRN file generated by PCL driver Pin
balu1234511-Mar-09 3:48
balu1234511-Mar-09 3:48 
AnswerRe: Edit the PRN file generated by PCL driver Pin
Roger Wright11-Mar-09 20:16
professionalRoger Wright11-Mar-09 20:16 
GeneralRe: Edit the PRN file generated by PCL driver Pin
balu1234511-Mar-09 23:49
balu1234511-Mar-09 23:49 
Iam Using c#.net,I made the following 2 methods for it

First Method:
public void writetofile(string JobOwnerName, string genfilename)
{
try
{
string fileContent = string.Empty;
string NewOwnername = "@PJL SET JOBATTR=" + '"' + "@JOAU=" + JobOwnerName + '"';//@PJL SET JOBATTR="@JOAU + JobOwnerName + "

string strTextFileName = genfilename;
string strTextToInsert = NewOwnername;
ArrayList lines = new ArrayList();
StreamReader rdr = new StreamReader(strTextFileName);
//String search_str = "%-12345X@PJL JOB";
//String search_str = "%-12345X@PJL JOB MODE=PRINTER";
String search_str = "@PJL JOB MODE=PRINTER";
string line;
string s = "@PJL SET JOBATTR=" + '"' + "@JOAU=";
while ((line = rdr.ReadLine()) != null)
{
if (line.StartsWith(s))
{

lines.Remove(line);
}
else
{
lines.Add(line);
}


}
rdr.Close();
lines.Insert(lines.IndexOf(search_str) + 1, strTextToInsert);
StreamWriter wrtr = new StreamWriter(strTextFileName);
foreach (string strNewLine in lines)
wrtr.WriteLine(strNewLine);
wrtr.Close();
}
catch (Exception ex)
{


}
}


2nd method:
string JobOwnerName = "suman" + '"';
string path = @"C:\D.prn";
string temp = @"C:\DD.prn";
string test1 = "@PJL SET JOBATTR=" + '"' + "@JOAU=" + JobOwnerName + '"';
string s = "@PJL SET JOBATTR=" + '"' + "@JOAU=";
string line;
StreamReader sr = new StreamReader(File.Open(path, FileMode.Open));
StreamWriter sw = new StreamWriter(File.Open(temp, FileMode.Create));

while ((line = sr.ReadLine()) != null)
{
line = sr.ReadLine();
if (line.StartsWith(s))
{
line = line.Replace(line.Substring(line.IndexOf('"') + 7), JobOwnerName);
sw.WriteLine(line);
sw.Write(sr.ReadToEnd());
break;
}
else
sw.WriteLine(line);
}

sw.Close();
sr.Close();

----------------------------------------------------------------------
Sir,
Kindly go through the above methods I have developed..

Kindly help me Iam waiting for your favourable reply
AnswerRe: Edit the PRN file generated by PCL driver Pin
Sebastian Schneider18-Mar-09 0:44
Sebastian Schneider18-Mar-09 0:44 
QuestionBluetooth Communication and Device Drivers Pin
Michael Fritzius8-Mar-09 12:35
professionalMichael Fritzius8-Mar-09 12:35 
AnswerRe: Bluetooth Communication and Device Drivers Pin
Roger Wright11-Mar-09 20:22
professionalRoger Wright11-Mar-09 20:22 
GeneralRe: Bluetooth Communication and Device Drivers Pin
Michael Fritzius12-Mar-09 4:47
professionalMichael Fritzius12-Mar-09 4:47 
GeneralRe: Bluetooth Communication and Device Drivers Pin
Roger Wright13-Mar-09 2:59
professionalRoger Wright13-Mar-09 2:59 
GeneralRe: Bluetooth Communication and Device Drivers Pin
Dave Kreskowiak13-Mar-09 8:56
mveDave Kreskowiak13-Mar-09 8:56 
AnswerRe: Bluetooth Communication and Device Drivers Pin
Giorgi Dalakishvili13-Mar-09 9:36
mentorGiorgi Dalakishvili13-Mar-09 9:36 
GeneralRe: Bluetooth Communication and Device Drivers Pin
Michael Fritzius16-Mar-09 4:29
professionalMichael Fritzius16-Mar-09 4:29 
GeneralRe: Bluetooth Communication and Device Drivers Pin
Giorgi Dalakishvili16-Mar-09 5:54
mentorGiorgi Dalakishvili16-Mar-09 5:54 
QuestionAbout Lightscribe. Pin
Nanda_MR5-Mar-09 18:19
Nanda_MR5-Mar-09 18:19 
AnswerRe: About Lightscribe. Pin
Sebastian Schneider5-Mar-09 23:18
Sebastian Schneider5-Mar-09 23:18 
AnswerRe: About Lightscribe. Pin
Dave Kreskowiak6-Mar-09 3:31
mveDave Kreskowiak6-Mar-09 3:31 
AnswerRe: About Lightscribe. Pin
supercat99-Mar-09 6:21
supercat99-Mar-09 6:21 
GeneralRe: About Lightscribe. Pin
Sebastian Schneider10-Mar-09 5:20
Sebastian Schneider10-Mar-09 5:20 
GeneralRe: About Lightscribe. Pin
supercat910-Mar-09 6:37
supercat910-Mar-09 6:37 
QuestionGood site [modified] Pin
dora.ureten4-Mar-09 2:37
dora.ureten4-Mar-09 2:37 
AnswerSPAMMING SCUM Pin
Dan Neely4-Mar-09 3:41
Dan Neely4-Mar-09 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.