|
Hi,
I have created a proxy socket with a TCPListener which receives client connections and sends request to the backend webserver and sends the response back from the backend server to the clients.
In this excercise, the HTML part is getting transferred correctly but the Images are not getting transferred. I am able to transfer only BMP images.
After receiving the response from the backend server, I check if the mime type returned is text or not. If it is text then I convert the bytes into string and pass on to the client socket. If it is not text(i.e. image) then send it in the same byte form as sent by the backend server. This works only for BMP images and not GIF or JPG images.
please help
|
|
|
|
|
Visual Basic 2005 Express Edition:
My application creates a one page report and prints it out. The page includes an image.
Now, I would like to save that page to a file, so, that it could later be retrieved and viewed on the screen and also have the ability to reprint it.
|
|
|
|
|
You could print it to a pdf printer driver,
or print it to an EMF spool file and use the EMF Spoolfile Viewer in my articles on this site to print/preview it thereafter
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
OK, but, which one should I go with (I am planning to market this program)?
|
|
|
|
|
I recomend the pdf way - it is a defacto industry standard imo
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
How do I implement a pdf printer driver?
I already created the printed page using:
.DrawString
.Graphics.DrawRectangle
.DrawImage
system.Drawing.Printing.
PrintPreviewDialog()
|
|
|
|
|
The code below got PDFcreator to create a PDF file, but, it didn't use my .PrintFileName or my .PrintToFile = True.
I want it to create the PDF file without the user having to enter the filename or to have to check the "Print to File" box. In fact, I don't even want a print dialog, I just want PDFCreator to write out the PDF file without the user knowing anything about it. Then, I will do a PrintPreviewDialog() that will ask him if he wants a hard copy.
Dim dlg As New PrintDialog()
dlg.Document = mDoc
With mDoc.PrinterSettings
.PrinterName = ("PDFCreator")
.PrintFileName = (PrintFileName)
.PrintToFile = True
If dlg.ShowDialog = Windows.Forms.DialogResult.OK Then
mDoc.Print()
End If
End With
|
|
|
|
|
hi,
how can i split a string of word into one word using vb6?
for example :
i want to split a word of "download"
to be one word
like this "d","o","w","n","l","o","a","d"
thank you for your kindness...
Ihsan
|
|
|
|
|
I'm not 100% sure what you mean, but I think this might be what youre after:
<br />
dim sWord as string<br />
dim sSplit() as string<br />
sWord = "download"<br />
redim sSplit(len(sWord)-1)<br />
dim iPos as long<br />
for iPos = 1 to len(sWord)<br />
sSplit(iPos - 1) = mid(sWord, iPos, 1)<br />
next iPos<br />
This will give you an array of single character strings; sSplit(0) = "d", sSplit(1) = "o", etc.
|
|
|
|
|
VS 2003, sql server
I get the following error:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView'
does not contain a property with the name LastDate.
Source Error:
Line 73: <%# DataBinder.Eval(Container.DataItem,"LastDate","{0:MM/dd/yyyy}") %>
My view is as follows:
CREATE VIEW dbo.vFieldReport
AS
SELECT dbo.Borrower.BName, dbo.FieldReports.CIF, dbo.FieldReports.FRID, dbo.FieldReports.LastDate,
dbo.FieldReports.DueDate, dbo.FieldReports.Overide,
dbo.FieldReports.NewDueDate, dbo.FieldReports.Freq,
dbo.FieldReports.DepthLevel, dbo.FieldReports.OrderDate, dbo.FieldReports.comments,
dbo.FieldReports.RiskRating, dbo.FieldReports.UCSClass, dbo.Loans.LoanNo
FROM dbo.Borrower INNER JOIN
dbo.FieldReports ON dbo.Borrower.CIF = dbo.FieldReports.CIF CROSS JOIN
dbo.Loans
My FieldReports Table is as follows:
Column Name Data Type Length Allow Nulls
LastDate dateTime 8 Yes
Here is the whole error code:
Server Error in '/COMS' Application.
--------------------------------------------------------------------------------
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.
Source Error:
Line 71: <itemstyle wrap="False" horizontalalign="Center">
Line 72: <itemtemplate>
Line 73: <%# DataBinder.Eval(Container.DataItem,"LastDate","{0:MM/dd/yyyy}") %>
Line 74:
Line 75: <edititemtemplate>
Source File: c:\inetpub\wwwroot\COMS\FieldReport.aspx Line: 73
Stack Trace:
[HttpException (0x80004005): DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.]
System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +146
System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +71
System.Web.UI.DataBinder.Eval(Object container, String expression) +82
System.Web.UI.DataBinder.Eval(Object container, String expression, String format) +12
ASP.FieldReport_aspx.__DataBind__control29(Object sender, EventArgs e) in c:\inetpub\wwwroot\COMS\FieldReport.aspx:73
System.Web.UI.Control.OnDataBinding(EventArgs e) +66
System.Web.UI.Control.DataBind() +26
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) +169
System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) +1408
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +49
System.Web.UI.WebControls.BaseDataList.DataBind() +23
COMS.FieldReports.BindData(Int32 intPageIndex, String strSortExp, String strSortOrder, String strBranch, String strBranchJ, String strBranch1, String strBranch9, String strType) +450
COMS.FieldReports.Page_Load(Object sender, EventArgs e) +185
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
|
|
|
|
|
hi, i would like to change the coding..but hten when when i change, the error turn out like this..
the loginADMINID, loginADMINNAME, loginADMINSTAFFNO, is nor declared..
what should i do to solve this error..the coding i slike this..
loginADMINID = txtUser.Text
loginADMINNAME = DsAdminLogin.Tables(0).Rows(0).Item("ADMINNAME")
loginADMINSTAFFNO = DsAdminLogin.Tables(0).Rows(0).Item("ADMINSTAFFNO")
loginPwd = txtPwd.Text
|
|
|
|
|
You need to declare the variables.
Dim loginAdminID as String
For example.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i still cannot login,i dont know where shoul di check for it..
Private Function str_admin1() As String
Dim temp As frmAdminmenu
Dim loginAdminID As String
Dim loginADMINNAME As String
Dim loginADMINSTAFFNO As Integer
'Build connection to database
Dim myConnect As OleDbConnection = New OleDbConnection("Provider=MSDAORA.1;User ID=etuser;Password=etuser;Data Source=etlog.petronas.com.my")
'Clarify the database conn datatypes
Dim strsql As String
Dim strcount As String
'Dim userdata As OleDb.OleDbDataAdapter
Dim DsAdminLogin As New DataSet
Dim strcon As String
'Query SELECT stmt and assign into String
strsql = "Select ADMINID,ADMINPASSWORD,ADMINNAME,ADMINSTAFFNO from ADMIN1 where ADMINID='" & Me.txtUser.Text & "' and ADMINPASSWORD = '" & Me.txtPwd.Text & "'"
OleDbDataAdapter1 = New OleDb.OleDbDataAdapter(strsql, myConnect)
OleDbDataAdapter1.Fill(DsAdminLogin, "ADMIN1")
'Count and retrieve data from DB
intResponse1 = DsAdminLogin.Tables(0).Rows.Count
If intResponse1 > 0 Then
loginADMINID = txtUser.Text
loginADMINNAME = DsAdminLogin.Tables(0).Rows(0).Item("ADMINNAME")
loginADMINSTAFFNO = DsAdminLogin.Tables(0).Rows(0).Item("ADMINSTAFFNO")
loginPwd = txtPwd.Text
temp = New frmAdminmenu
Me.Hide()
temp.Show()
'strcount = "Select USERCOUNT from COUNT "
Else
MsgBox("Cannot login. Make sure your username and password are correct. Otherwise, you are not an authorized user to access this system.", MsgBoxStyle.Critical, "User Login Validation")
txtPwd.Text = ""
End If
End Function
sir..pls..help me..tq..
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbdataadapterclassfilltopic1.asp[^]
OleDbDataAdapter1.Fill(DsAdminLogin, "ADMIN1")
Your second parameter is a recordset, you're passing a string. Why ?
loginADMINID = txtUser.Text
loginADMINNAME = DsAdminLogin.Tables(0).Rows(0).Item("ADMINNAME")
loginADMINSTAFFNO = DsAdminLogin.Tables(0).Rows(0).Item("ADMINSTAFFNO")
loginPwd = txtPwd.Text
What's the use of all this ? You don't use these values anywhere, they will just be lost.
Me.Hide()
temp.Show()
If you're going to hide your main form, you'd do better to define your other form and your main form UI as user controls, and switch between them on the one form. As it stands, you have no mechanism in place for the form you're showing to close and your main form to reappear.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have attempted to use some of the new security classes in .NET 2.0. Question. How can I check the writes of the currently logged in user for a given resource suce as a file/directory. I want to know before taking an action if a user can write to a directory, can the user create a sub directory in a given directory on the network.
Here is what I have tried:
PUBLIC FUNCTION ReturnCheckMyRightsOnDirectory(XRightsToCheck AS DirectoryPermissions , XPath AS STRING) AS BOOLEAN
IF MY.Computer.FileSystem.DirectoryExists(XPath) = FALSE THEN
RETURN FALSE
END IF
TRY
DIM DirectoryName AS STRING = XPath
Dim dInfo AS NEW DirectoryInfo(DirectoryName)
Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()
DIM DirectoryRightToCheck AS FileSystemRights
SELECT CASE XRightsToCheck
CASE DirectoryPermissions.Create
DirectoryRightToCheck = FileSystemRights.CreateDirectories
CASE DirectoryPermissions.Read
DirectoryRightToCheck = FileSystemRights.Read
CASE DirectoryPermissions.Update
DirectoryRightToCheck = FileSystemRights.Modify
CASE DirectoryPermissions.Delete
DirectoryRightToCheck = FileSystemRights.Delete
CASE DirectoryPermissions.Write
DirectoryRightToCheck = FileSystemRights.Write
CASE DirectoryPermissions.Execute
DirectoryRightToCheck = FileSystemRights.ExecuteFile
CASE DirectoryPermissions.Admin
DirectoryRightToCheck = FileSystemRights.FullControl
END SELECT
dSecurity.AddAccessRule(New FileSystemAccessRule(SystemUserName, DirectoryRightToCheck, AccessControlType.Allow))
dInfo.SetAccessControl(dSecurity)
RETURN TRUE
CATCH ex As Exception
RETURN FALSE
END TRY
END FUNCTION
|
|
|
|
|
Hallo,
Can anyone help me with a guideline on how to add a record (line) in an Excel heet? All i could find in the help files is how to import data from excel into a dataset object, but nothing on how to do the opposite.
From the help files i gather that it's as if working with a database table. The question is should I add parameters (and how), and what is the syntax for inserting the data?
Thank you in advance.
|
|
|
|
|
how ComboBoxCell in DatagridView Can be Autocomplete and use Item dictionary like other comboBoxes
|
|
|
|
|
How can I create a sudoku solver
Passion
|
|
|
|
|
You could have search CodeProject for Sudoku[^] and would have found some articles already implementing what you want.
|
|
|
|
|
If you really want to see what goes into creating one, check this[^] out.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi!
Can someone help me how to instance an axtivex object from a remote activex server? Createobject fuction will result in an error saying that the class is not registerd.
I created an activex server which is running in a separate computer. all my clients should take instances from that server. but i cannot do that with CreateObject in my client side programs. I am using VB6...
How can i do that????
Thanks
Leelanga
-- modified at 9:52 Monday 1st May, 2006
|
|
|
|
|
Actually, you DO use CreateObject. The problem is that your client machines don't know where the object is that is to be created. You can't just tell the machine Create this on this machine. You still need to register the COM object on the client machine. It's in that registration that the details of where that object is are stored.
Wow. I really need to dig up the old source. The last time I did something like this in VB6 was about 6 years ago. I wrote a keylogger that popped up a window on my machine the instant the remote server was instantiated on the client machine. Now where did I put that stuff...
You can start with this[^] little KB article to give you the basic idea.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave
Thanks a lot for that link. It was grate. Hay can you tell me another thing…is there any way that I can track all the instances of a particular activex server. What I want is to send a signal to all my clients at that moment. How could I do that in VB6?
Thanks a lot once again
Leelanga
|
|
|
|
|
Your server has to be written to be a Singleton (Single Instance) and has to be written to keep track of all the clients that connect to it. There is nothing that will do this for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello I would wish to print on a sheet with the A4 format forty calculations which would be generated by the computer. (I had to create a program in vb6 who did that thanks to an additional component called nifprint here With vb 2005 express , I do not know, by what to start to carry out such a print. I know how to create calculations, but how to store them for then printing them?
what do need I : which control do i have to use for, then, using the new print controls (previewing and C°) offer in vb 2005 ?
Thanks for giving me a guide line.
quisnam igitur sanus ?
|
|
|
|
|