|
Is it possible to do this in a batch file maybe??? I rename the file in a batch file... so is it possible to count the rows in a batch file and then delete it if rows are less then 1 in the batch file before i rename the text file???
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Batch file?? You could probably hack somethline together, though this is too easy to write yourself. Just use a FileStream and a vairable to increment. Read the file line by line and increment a counter for each line.
Imports System.Io
.
.
.
Public Shared Function CountLinesInFile(ByVal filepath As String) As Integer
If File.Exists(filepath) Then
Using fs As New StreamReader(filepath)
Dim count As Integer = 0
While Not fs.EndOfStream
fs.ReadLine()
count += 1
End While
Return count
End Using
End If
Throw New FileNotFoundException(filepath)
End Function
|
|
|
|
|
Thank you.
I will put it to good use
Enjoy the rest of your day.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Thank you, i tested it and it is working fine. Thank you for your time
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
i want to design(program) for a internet cafe that computes In/Out of each workstation.
at the same time, it can shutdown, restart, log off and lock the workstation? kindly help me pls?
what should i do? what code should i write? help me pls
|
|
|
|
|
The first part is easy, just use a timer.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Investigate this page for shutdown/restarting...
|
|
|
|
|
Hi
I created these classes :
MustInherit Class DataTableManager
Inherits UserControl
End Class
Class OrderManager
Inherits DataTableManager
End Class
When I open OrderManager in designer , I get : Warning - The designer must create an instance of type 'DataTableManager' but it cannot because the type is declared as abstract.
Is there any way to open OrderManager in designer ?
|
|
|
|
|
Nope. If there is an abstract class in the inheritance chain, it won't work.
The designer cal only work with concrete classes.
|
|
|
|
|
sometimes the issue is the datatablemanager wasn't compiled. we have class that we call "formbase". all of our forms inherit from it. sometimes when that class is changed or something related to it changes, I have to compile the project that class is in then my form that inherits from it will show. a control would follow under the same behavior...
|
|
|
|
|
Hi,
i am developing a project(vb.net 2005) which acts like an Office Viewer. That means that on a form, the user will be able to see or change page/worksheet etc, of a Word or Excel or Powerpoint file(including Office 2007). Is there any idea how to do this?
ninkk
|
|
|
|
|
|
Man you're impatient.
The problem with doing this is that you have to use Word, PowerPoint, Excel, Access, all that junk installed, so it really makes your app pointless.
Besides, Microsoft already has smaller view applications[^] for all those file types.
|
|
|
|
|
Ok, but Microsoft viewers are stand alone application. What i need is to be able to view office files within a .net project. Maybe there exists a component control, and after you drag and drop it on the form, to give filename and to see the office files(something from microsoft or 3rd party)? For example, in order to see Pdf files, you can install Adobe Reader and add in toolbox Adobe Pdf Reader from COM Components. Is there any to do this for .doc, .docx, ppt, etc... ????
|
|
|
|
|
Maybe this[^]. The only problem is that it's $500 for a single developer license and $999 for distribution license where you can actually sell your app with the component in it. It's the only one I know of. I don't recommend it because it's so bloody expensive.
Other than that, you can use the Office Primary Interop Assemblies to use Office apps inside your app. I don't do Office Interop so my experience with it is very limited.
|
|
|
|
|
is there any diffrence between procedure and function?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Yes a Sub doesn't return a value and a Function returns a value.
Ben
|
|
|
|
|
u mean procedure and sub are synonyms?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
If you are writing vb.net code you only have sub and function.
Ben
|
|
|
|
|
Yeap,
Procedures executes the commands and returns nothing, on the other hand, function should always return something(integer or string, etc), to the point that they were called from.
|
|
|
|
|
better to say is that as we have "void" return type of a function i.e. a function that doesn't return a value in many languages like C++, C# or Java in visual basic we have sub for this purpose. i.e. sub is a function with void void return type
Salman Sheikh
|
|
|
|
|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
out of the above mentioned
i think
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
is the handler
and Handles MyBase.Load is an event
Am i right?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Yes, I think you are right.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
handles mybase.load is indeed the event this sub handles
the event passes 2 parameters to the sub therefor you need the
Sonia Gupta wrote: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
so you could call it the handler
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
1 - buy a book, please
2 - learn how to format your questons, 'please help' is just painful.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|