|
You need to move your data pointer variables (e.g. Static currentRow As Integer ) outside of the PrintPage event and reset them on the BeginPrint event.
See this article on Printing[^] for more info.
|
|
|
|
|
Took me a while to figure out what you were talking about. But I got it. Since my page, and rowCount was static, it was just staying at the end of my data, so it had no data to print. It was saying "IM ALREADY AT THE END OF YOUR DATA!!!"
|
|
|
|
|
Hi all,
i wanted to ftp files to unix box in VB.net
1. Need to ftp files from windows to unix box
2. Need to create directory in unix box
3. After the file is uploaded need to check the file size
please provide me the code in vb.net
Thanks in advance
|
|
|
|
|
Search Google for "VB.NET FTP", and you'll be buried under the examples. It doesn't matter much what Operating System you use, as long as it supports the FTP-protocol.
|
|
|
|
|
naveengopinath wrote: please provide me the code in vb.net
Write you own code. CP works by helping people with their own code, not by writing it for you.
If you want it written for you, go to RentACoder.com
|
|
|
|
|
|
Hello friends,
I have a VB application to load the txt files to SQL server. For loading the files, i want to specify the folder where the txt files are.Then it will load the files to the server. Now what the customer wants is, to load the files automatically. ie , if any new files are added to the folder,it has to be loaded to server, with out any user interphase
I am planning to call my application from windows scheduled task once a day and will check the folder for any news files are added.
My problem is,how to check any updates has happened to the folder. Please help me for getting the same.
I dont have much experience on application programming. So please try to give code for how to check any new files are added to the folder.
Jish
|
|
|
|
|
Two options;
If your program is running continuously, you can use the fileSystemWatcher-component. That will only work if your application is running all the time.
The second option is to create a list of the files and their dates. Save the list to disk, and compare it to the directory-structure when your application starts. That way your application won't be required to run continuously.
|
|
|
|
|
Thanks for giving the Solution!!!
hope second one is more suitable,Because i am planning call the application using the schedular.
But how to comapare the list on disk withthe directory-structure using VB.
Can you please give any sample code to do so.
regards
Jishith
|
|
|
|
|
When you have imported the text file, you could rename the file by changing the extension or even deleting the file, assuming the original file is no longer required. You program then only needs to look for txt files in the designated folder.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I gave options, not solutions - you still got a lot of work to do
Let's take it one step at a time;
- You'll have to write a method to 'save' the contents of the folder first. Once you got that working, you can try to compare them with the current values.
- Before writing a method to 'save' the contents, you'll have to have code that gives you the current contents of a folder.
Do you need to watch a directory, or do you also need to watch the subdirectories?
|
|
|
|
|
eddyvluggen wrote: create a list of the files and their dates. Save the list to disk, and compare it to the directory-structure when your application starts
Or use WMI permanent event subscription[^]
In January you said "Money in April" -
That was two years ago!
B. Python
|
|
|
|
|
Hi,
I use the following code to check if there is on the internet a new version
''' <summary>
''' Check for download and if one, download it
''' </summary>
''' <param name="HTTPPath">that basepath where all files will be found on the internet</param>
''' <remarks></remarks>
Function sCheckUpdate(ByVal HTTPPath As String) As Boolean
Dim wc As Net.WebClient = Nothing
Dim bReturn As Boolean
Try
Dim fileProgram As String = New IO.FileInfo(Application.ExecutablePath).FullName
Dim fi As New IO.FileInfo(fileProgram)
Dim VerUri As String = Left(fi.Name, fi.Name.Length - fi.Extension.Length) & ".txt"
VerUri = IO.Path.Combine(HTTPPath, VerUri).Replace("\", "/")
Dim dest As String = Left(fi.FullName, fi.FullName.Length - fi.Extension.Length) & ".zip"
If Not HTTPPath.EndsWith("/") Then HTTPPath &= "/"
HTTPPath &= Left(fi.Name, fi.Name.Length - fi.Extension.Length) & ".zip"
Dim png As New System.Net.NetworkInformation.Ping
Dim rep As System.Net.NetworkInformation.PingReply
rep = png.Send("74.125.47.118", 3000) 'google / 193.191.180.197=post
If rep.Status = Net.NetworkInformation.IPStatus.Success Then
wc = New Net.WebClient
'Dim pProxy As Net.WebProxy = Net.HttpWebRequest.DefaultWebProxy
'wc.Proxy = pProxy
Dim version As Byte() = wc.DownloadData(VerUri)
Dim sHTTPver As String = System.Text.ASCIIEncoding.ASCII.GetString(version)
Dim vnCurrentVersion As System.Version = fVersionNumber()
Dim nVersion As Double = Val(vnCurrentVersion.Build & "." & vnCurrentVersion.Revision.ToString("00000"))
Dim nhttpVer As Double = Val(sHTTPver)
If nhttpVer > nVersion Then
If MessageBox.Show(LangSet.Update.NewExist, LangSet.Update.Available, _
MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
wc.DownloadFile(HTTPPath, dest)
bReturn = True
End If
ElseIf nhttpVer < nVersion Then
MessageBox.Show("Your version is better than on the internet", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show(LangSet.Update.NewestVersion, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Else
MessageBox.Show(LangSet.Update.NetWorkError & Environment.NewLine & Environment.NewLine & rep.Status.ToString)
End If
png.Dispose()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
If Not wc Is Nothing Then
wc.Dispose()
End If
Return bReturn
End Function
however, If someone use a proxy with login and password the function fails. how can I get that information on the brouwser?
getdefaultbrouwser give the error this function is outdated
Jan
|
|
|
|
|
hi all,
In my program, i have multiple point. these points can make different closed diagram but i have no idea that how can i draw a diagram on the basis of point. I want to ask whether there are any class in .Net which take different point and draw closed diagram on the basis of point ? I am using visual studio 2005
|
|
|
|
|
I guess DrawClosedCurve method of Graphics class will help you.
|
|
|
|
|
Thanks danish,
I want to know one more thing. Whether there are any method to fill this area to any color ?
|
|
|
|
|
FillClosedCurve?
If you use Object Browser you will find everything in Graphics class.
|
|
|
|
|
I am working on a project with 1 Grandparent 1 parent and multiple grandchildren
The following are tables and their configuration
Grandparent : Equipment
Fields : Eqpt_ID (PK) etc...
Parent : Equipment_Task
Fields : EQPT_TASK_ID (PK), EQPT_ID (FK), etc...
Grandchildren1 : Task_Procedure
Fields : TASK_ID(pk), EQPT_TASK_ID (FK)etc...
The Equipment table connects to Equipment_Task Table through EQPT_ID
and the Eqpt_Task connects to Task_procedure Table through EQPT_TASK_ID
This is how the dataset is organized :
Dim Table0 As New tblEquipment ' Grandparent
Dim Table1 As New tblEQPT_Task '
Dim Table2 As New tblEqptTaskProcedure
MyBase.Tables.Clear()
MyBase.Relations.Clear()
MyBase.Tables.Add(v_Table0)
MyBase.Tables.Add(v_Table1)
MyBase.Tables.Add(v_Table2)
Dim myDataRelation = New DataRelation("EqptTaskProcedure", Table1.Columns("EQPT_TASK_ID"), Table2.Columns("EQPT_TASK_ID"))
myDataRelation.nested = True
MyBase.Relations.Add(myDataRelation)
.
.
.
I have the following codes in my form
BindingSource1.DataMember = ""
BindingSource1.DataSource = dstEquipment.tblEquipment
The following code works
dgvEqpt_Task.DataSource = dstEquipment.tblEQPT_TASK
dgvEqpt_Task.Columns(0).DataPropertyName = "Task_Code"
While this does not work ?
Me.DataGridView1.DataSource = dstEquipment.tblEqptTaskProcedure
Me.DataGridView1.Columns(0).DataPropertyName = "Line_No"
dstEquipment.BindingSource = BindingSource1
BindingSource2.DataMember = ""
BindingSource2.DataSource = dstEquipment.tblEQPT_Task
can somebody help me please?
Empty your cup and have it filled
|
|
|
|
|
Hai friendz....
I would like to know how to write into files using vb.net 2005.
I like to save the passwords of my application in a encrypted text files .
I will be thank ful to you if you are providing me the solution.
Ihope you will...................
REVATH S KUMAR
|
|
|
|
|
revath wrote: I will be thank ful to you if you are providing me the solution.
I bet you would, getting code for free. Try rentacoder.com, or wrte your own code. There are thousands of examples on Google.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Nobody here is going to write your code for you.
Reading and writing text files is basic stuff and there are plenty of examples if you google them.
There is a standard set of functions within the .NET framework for excryption including MD5 (see the System.Security.Cryptography namespace).
I would encrypt the password (using MD5 for example) then write the encrypted password to your file.
To validate the password, encrypt the user enter password using the same encrytion method and see if the user enter encrypted password matches the encrypted password stored in the file.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I'm trying to make this application appear in the bottom right of the screen no matter what resolution the screen is at so I created this code.
Dim Width1 As Integer = Screen.PrimaryScreen.Bounds.Width
Dim Height1 As Integer = Screen.PrimaryScreen.Bounds.Height
Dim X As Integer = Me.Location.X
Dim Y As Integer = Me.Location.Y
X = (Width1 - Me.Width)
Y = (Height1 - Me.Height)
Which runs when a button is clicked however, whenever the button is clicked nothing happens so I changed the X and Y on the bottom two lines to Textbox1.Text = (Width1- Me.Width) and Textbox2.Text = (Height1 - Me.Height) and the textboxes showed the correct numbers.
What is wrong with my code? I know it deals with the Me.Location.X and Me.Location.Y but am unsure why. Thanks for your help in advance.
modified 8-Sep-21 21:01pm.
|
|
|
|
|
Uhhh, if this is all of the code, you didn't set the location to the new values.
Me.Location = New Point(X, Y)
|
|
|
|
|
Hi,
you can condense that to the single statement
Me.Location = New Point(Screen.PrimaryScreen.Bounds.Width-Me.Width,<br />
Screen.PrimaryScreen.Bounds.Height-Me.Height)
This may or may not require a correction depending on how you want to deal with the task bar.
|
|
|
|
|
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal hwndParent As Integer, ByVal ByValfRequest As Integer, ByVal lpszDriver As String, ByVal lpszAttributes As String) As Integer
Private Const vbAPINull As Integer = 0 ' NULL Pointer
Private Const ODBC_ADD_DSN As Short = 4 ' Add data source
Private Const ODBC_REMOVE_DSN As Short = 6 ' Remove data source
Public Sub Create_System_DSN()
Dim intRet As Integer
Dim Driver As String
Dim Attributes As String
'Set the driver to SQL Server because it is most common.
Driver = "Microsoft Access Driver (*.MDB)"
Attributes = "DSN=Sipe" & Chr(0)
Attributes = Attributes & "DESCRIPTION=Sipe ODBC Connection" & Chr(0)
Attributes = Attributes & "DBQ=F:\Sipe.mdb" & Chr(0)
'To show dialog, use Form1.Hwnd instead of vbAPINull.
intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, Driver, Attributes)
If intRet <> 0 Then
MsgBox("DSN Created")
Else
MsgBox("Create Failed")
End If
End Sub
Above code in a form with a button click is working fine
Need help on how to create the same DSN after installing a software
Saseendran Kombath
modified on Sunday, November 2, 2008 12:07 PM
|
|
|
|