I want to design a software for check printing in c#.net. With the forms and design where the user can draw the labels. Is there any sample code available. Please send accross to me.
I don't have source code but I am using Cheque Printing Software. You can look at screen shots, forms and functionality they have implemented. I think GNPrinting.in is also developed in C# only. You can download demo and have a look at it.
How can i get an Image from WebBrowser?
WebBrowser is at Image url: http://xxxxx.xx/Image.jpg
but source of that is like a page that contains a picture. I want to get that stream.
I don't want to use FileWebRequest.
I'm creating a website and an application for that. I want to my users use website in a windows app. I created an invisible webbrowser and i send login data from it. When i want to download user's image and other images from site, my site can't recognize user. I want to use images in webbrowser in picturebox or download them with session of webbrowser and then show them.
public partial class Form1 : Form
//Declare these two variables globally so you can access them from both
//Button1 and Button2.
// Instantiate Excel and start a new workbook.
objApp = new Microsoft.Office.Interop.Excel.Application();
objBooks = objApp.Workbooks;
objBook = objBooks.Add(Missing.Value);
objSheets = objBook.Worksheets;
objSheet = (Microsoft.Office.Interop.Excel._Worksheet)objSheets.get_Item(1);
//Get the range where the starting cell has the address
//m_sStartingCell and its dimensions are m_iNumRows x m_iNumCols.
range = objSheet.get_Range("A1", Missing.Value);
range = range.get_Resize(5, 5);
//Create an array.
double[,] saRet = new double[5, 5];
//Fill the array.
for (long iRow = 0; iRow < 5; iRow++)
for (long iCol = 0; iCol < 5; iCol++)
//Put a counter in the cell.
saRet[iRow, iCol] = iRow * iCol * iCol;
//Set the range value to the array.
objApp.Visible = true;
objApp.UserControl = true;
// You should specify all these parameters every time you call this method,
// since they can be overridden in the user interface.
currentFind = objSheet.Cells.Find(A, Type.Missing,
Microsoft.Office.Interop.Excel.XlSearchOrder.xlByRows, Microsoft.Office.Interop.Excel.XlSearchDirection.xlNext, false,
while (currentFind != null)
// Keep track of the first range you find.
if (firstFind == null)
firstFind = currentFind;
// If you didn't move to a new range, you are done.
else if (currentFind.get_Address(Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlReferenceStyle.xlA1, Type.Missing, Type.Missing)
== firstFind.get_Address(Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlReferenceStyle.xlA1, Type.Missing, Type.Missing))
After finding the cell containing "16", i want to write in string data to the right of it. how should i go about doin this. I did some research on the codes, but i kept getting errors. Please advise me on my problem. Thanks alot!!
In what order is the Socket.BeginReceive/EndReceive functions called?
For instance, I call BeginReceive twice, once to get the message length and the second time to get the message itself. Now the scenario is like that, for every message I send, I start waiting for its completion (actually acknowledgment of the message sent, also I wait for the action's completion after receiving the acknowledgment), so I call BeginReceive with each BeginSend, but in each BeginReceive's callback, I check if I'm receiving the length or the message. If I'm receiving the message and have received it completely, then I call another BeginReceive to receive the completion of the action. Now this is where things get out of sync. Because one of my receive callback is receiving bytes which it interprets as the length of them message when in fact it is the message itself.
Now how do I resolve it?
Here is the code, basically it is too big, sorry for that
According to the documentation, each BeginXxx needs a corresponding EndXxx, and typically that can be handled by the callback method.
I can't tell you what exactly is wrong in your code, however it is my impression your code is too complex and not sufficiently safe. I would code this more defensively, and avoid all the global variables your class seems to hold (receiveDataBuffer, bytesReceived, messageLengthReceived).
These are things I would do differently:
I would create a little class holding clientSocket, the receive data buffer, an index into it;
then create two instances (one for length, one for data) of it for each length+data communication, and pass them as the last parameter to the BeginReceive calls (and retrieve it from the EndReceive calls).
I would completely split the WaitForData() method into a WaitForLength method and a WaitForData method.
And I would completely split the RecieveComplete() method into a ReceivedLength method and a ReceivedData method.
(2) makes messageLengthReceived redundant.
(1) avoids the risk of receiveDataBuffer and bytesReceived to contain data belonging to another ongoing communication.
I am not saying the problem will be solved by doing this, I do claim the code would be more robust and easier to read, and either the problem is gone, or you'll have a better chance of locating the problem.
FWIW: I'm puzzled by AsyncClient.BUFFER_SIZE, it appears only once in the code shown; is it the size required to hold the length part only?
I am looking for code to generate thumbnail for the first page of Microsoft Office document (such as word,excel) and PDF. I found sth like this in MSDN and tried it, however, what is the missing reference for "Doc" as in the first line. What reference should I use for the "Doc"?
InlineShapes shapes = Doc.InlineShapes;
int i = 0;
foreach (InlineShape shape in shapes)
if (shape.Type == WdInlineShapeType.wdInlineShapePicture)
IDataObject data = Clipboard.GetDataObject();
Image image = (Image)data.GetData(DataFormats.Bitmap, true);
Could anybody kindly help me with this? Will this code do the job or you guys have better solutions? Thank you very much.
Last Visit: 31-Dec-99 18:00 Last Update: 27-Jul-17 5:11