I have seen a few different functions such as "ParseBetween" and "ParseBetweenAll"butI was wondering if there is such a function that you may know of so I could parse HTML code, such as:
Hi! I have an issue regarding datagridview I have insert 5 items then whenever i save the record only 4 items is save. I observe that if I don't tab the last item it will not save. How to save all items without tab or go to new line?
Hello, this is my first asp.net web appplication , I'am trying to insert something to the database but it dosen't work and the label keep giving me error on catch ex . help please , here is my code[/size]
i even tried every option from smoothingmode but nothing seems to work
i can't keep the nice clean quality of the image has a transparency background like a png or gif file.
I wonder if it is possible to grap info (such as post count, etc.) from a user that login using httpwebrequest? If so, how? The website I wan't to grab user info from is an IPB board.
Hi guys I'm about to create report in vb.net but I couldn't good example in previous vb6 i can create unbound data report now and vb.net it's hard to find a good sample unbound report viewer. It is possible to control data pass using SQL script with parameters date or filter by certain field. How to pass value from data reader to textbox or table. I'm currently using MySQL database.
Hi everyone I found some code while google to print on default printer it's working fine except it's not behave what i would like to do sending data to printer. Below is the class code for printer.
Public Class Rawprinter
' ----- Define the data type that supplies basic
' print job information to the spooler.
<StructLayout(LayoutKind.Sequential, _
CharSet:=CharSet.Unicode)> _
Public Structure DOCINFO
<MarshalAs(UnmanagedType.LPWStr)> _
Public pDocName As String
<MarshalAs(UnmanagedType.LPWStr)> _
Public pOutputFile As String
<MarshalAs(UnmanagedType.LPWStr)> _
Public pDataType As String
End Structure
' ----- Define interfaces to the functions supplied
' in the DLL.
<DllImport("winspool.drv", EntryPoint:="OpenPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function OpenPrinter( _
ByVal printerName As String, ByRef hPrinter As IntPtr, _
ByVal printerDefaults As Integer) As Boolean
End Function
<DllImport("winspool.drv", EntryPoint:="ClosePrinter", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function ClosePrinter( _
ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.drv", EntryPoint:="StartDocPrinterW", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function StartDocPrinter( _
ByVal hPrinter As IntPtr, ByVal level As Integer, _
ByRef documentInfo As DOCINFO) As Boolean
End Function
<DllImport("winspool.drv", EntryPoint:="EndDocPrinter", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EndDocPrinter( _
ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.drv", EntryPoint:="StartPagePrinter", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function StartPagePrinter( _
ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.drv", EntryPoint:="EndPagePrinter", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EndPagePrinter( _
ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.drv", EntryPoint:="WritePrinter", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function WritePrinter( _
ByVal hPrinter As IntPtr, ByVal buffer As IntPtr, _
ByVal bufferLength As Integer, _
ByRef bytesWritten As Integer) As Boolean
End Function
Public Shared Sub PrintRaw( _
ByVal printerName As String, _
ByVal origString As String)
' ----- Send a string of raw data to the printer.
Dim hPrinter As IntPtr
Dim spoolData As New DOCINFO
Dim dataToSend As IntPtr
Dim dataSize As Integer
Dim bytesWritten As Integer
' ----- The internal format of a .NET String is just
' different enough from what the printer expects
' that there will be a problem if we send it
' directly. Convert it to ANSI format before
' sending.
dataSize = origString.Length()
dataToSend = Marshal.StringToCoTaskMemAnsi(origString)
' ----- Prepare information for the spooler.
spoolData.pDocName = "Print Document"
spoolData.pDataType = "RAW"
Try
' ----- Open a channel to the printer or spooler.
Call OpenPrinter(printerName, hPrinter, 0)
' ----- Start a new document and Section 1.1.
Call StartDocPrinter(hPrinter, 1, spoolData)
Call StartPagePrinter(hPrinter)
' ----- Send the data to the printer.
Call WritePrinter(hPrinter, dataToSend, _
dataSize, bytesWritten)
' ----- Close everything that we opened.
EndPagePrinter(hPrinter)
EndDocPrinter(hPrinter)
ClosePrinter(hPrinter)
Catch ex As Exception
MsgBox("Error occurred: " & ex.ToString)
Finally
' ----- Get rid of the special ANSI version.
Marshal.FreeCoTaskMem(dataToSend)
End Try
End Sub
End Class
Private Function __getDefaultPrinterName() As String
Try
Dim __pname As String = String.Empty
Dim _printDialog As New System.Windows.Forms.PrintDialog
__pname = _printDialog.PrinterSettings.PrinterName '= "set as Default printer"
Return __pname
Catch ex As Exception
Return String.Empty
' System.Windows.Forms.MessageBox.Show("could not printed Label.", "Print Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Function
Private Sub PrintItems()
For Each lvItem As ListViewItem In lv_list.Items
Rawprinter.PrintRaw(__getDefaultPrinterName, lvItem.SubItems(0).Text & " ----------- " & lvItem.SubItems(1).Text)
Next
End Sub
It print only 1 line then next item will be printed on the next page. How to print all items in one page?
Okay, so I seen news about IOS 7 today... What the heck is up with that? It looks like they copied the simplistic look that Microsoft adopted for Windows 8...
Apple copying Microsoft now? I must say that this is the lamest point in history for innovative designs. Is there no creativity anymore?