|
You are looking for them in a specific directory? If you just want to seach the whole computer that sounds a lot like a virus or spyware.
Imports System.IO
Use the Directory object to get a list of files.
Dim files As String() = Directory.GetFiles("c:\", "*.mp3")
Ben
|
|
|
|
|
Sorry I was not clear but I want to be able to search for any type of file specified. In other words I want to create a function and pass in a file name variable.
jds1207
|
|
|
|
|
Here is some code that I wrote but I am not sure if it is right.
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
Timer1.Enabled = True
SearchFiles(".txt")
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Check if the event log exists
If Not Diagnostics.EventLog.SourceExists("MyService") Then
'Create Log
Diagnostics.EventLog.CreateEventSource("MyService", "Myservice Log")
End If
EventLog.Source = "MyService"
'Write to the log
Diagnostics.EventLog.WriteEntry("MyService Log", "This is log on " & _
CStr(TimeOfDay), EventLogEntryType.Information)
End Sub
Private Sub SearchFiles(ByVal FileType As String)
Dim FilePath As String = "c:\"
Dim rootDi As New DirectoryInfo(FilePath)
Dim Di As DirectoryInfo
For Each Di In rootDi.GetDirectories
Directory.GetFiles(FilePath, FileType)
Next
End Sub
Am I using the code above correctly? I am trying to search for files using windows service in vb.net 2005. I want to be able to specify which file type I am searching for. Please help.
jds1207
|
|
|
|
|
HI,(all in vb 6.0)
i have an dll with a form and some public functions. i add reference of this dll in new project and try to change the command button's picture from calling project.the function gets executed smoothly but i didn't get the result(change in
command button's image).
Any help or hint is greatly appericiated.
Thanks in advance.
aamn.
amolk
|
|
|
|
|
have you tried using refresh method of the object or a doevents?
|
|
|
|
|
HI,
i tried using button.refresh but no output.
i also try to sendmessage api to change text using setwindotext and now i can change the caption of the button.
But i need to change the picture of button where i'm in trouble.
Please let me know any suggestion /links.
thanks
amolk.
amolk
|
|
|
|
|
hi there,
my project was working good but till when i change its icons ,its giving error when i press F5
Error 1 Unable to write to output file 'C:\Documents and Settings\Windows XP 2005\My Documents\Visual Studio 2005\Projects\*******\obj\Debug\*******.exe': The specified image file did not contain a resource section.
i got where is the problem....the problem occured when i change the icon of the application in "my project properties".
i tried alot to solve it but all in vain
someone know the solution?
-- modified at 11:24 Thursday 3rd May, 2007
|
|
|
|
|
Can someone tell me how to call a DB2 COBOL Stored Procedure in Visual Studio.Net? Thanks
|
|
|
|
|
Hello There
I have a two toolbars on my MDI form. both have 28 * 28 image size. now the icon which I attach with the toolbar button loose its image quality on load . Can any one help me that how can I fix this.
|
|
|
|
|
Hello!
I am using VB6.0 and Crystal Report XI.
I have designed different reports using Report Creation wizard by making connection to my Local SQL Server. It is fixed connection string now!
Please anybody help me how can i generate reports if my database in not on (Local) SQL Server?
Actually i want that all report designing remains same but connection property get changed at runtime......
...THANKS...
colgateas900197
|
|
|
|
|
This article at Business Objects[^] shows how to set the connection at runtime for vb.net.
|
|
|
|
|
while creating the dsn there is an error occuring.
Attempted to read or write memory . This is often an indication that other memory is corrupt.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CreateAccessDSN("Nilish", "d:\Database\dbase.mdb")
End Sub
Public Function CreateDSN(ByVal Driver As String, ByVal Attributes As _
String) As Boolean
CreateDSN = SQLConfigDataSource(0&, ODBC_ADD_SYS_DSN, _
Driver, Attributes)
End Function
Public Function CreateAccessDSN(ByVal DSNName As String, _
ByVal DatabaseFullPath As String) As Boolean
Dim sAttributes As String
If Dir(DatabaseFullPath) = "" Then Exit Function
sAttributes = "DSN=" & DSNName & " "
sAttributes += "DBQ=" & DatabaseFullPath & " "
CreateAccessDSN = CreateDSN("Microsoft Access Driver (*.mdb)", _
sAttributes)
End Function
|
|
|
|
|
Why are you even using a DSN in the first place? There's no reason for it anymore...
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
i have image files field in the database(MS-Access).
I wanted to display those images into the crystal reports.
How can i do it.
|
|
|
|
|
Hi!
I am facing some problem while reading from CSV file and updating database from the data available in csv file. My problem is that CSV files are too large having atleast 5000 rows and while updating database for each row I need to query database for atleast four times. It means I have to query the database for atleast 200,000 for a single file. This is retarding my application's processing speed and increasing load on machine as well as on database server. Please suggest me how to cope up with this problem?
Thanks and Regards,
Virendra
|
|
|
|
|
You should be using DTS (Data Transformation Services) for this, it would drastically bring down the time you would be spending in importing this data. The package can contain conditions and code to suit the business logic.
Have a look at these articles to get an idea about dts:
DTS VB .NET[^], DTS Export[^], Dynamic Creation of DTS Package[^]
|
|
|
|
|
Hi..
I have a textbox that was firing Text_changed event when the user press Enter.but now it is not firing any more.But the handler for this event is executed when a postback occur(for example when I click a button).
Could any one tell me how to solve this problem and make it working as before(when the user press Enter)?
I am too late but i will never give up
|
|
|
|
|
Please use ASP.NET forum as this is related to web
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Sorry I put it here by mistake.I will put it again in the asp.net forum.
I am too late but i will never give up
|
|
|
|
|
What have you changed that made it stop working?
The TextChanged event is a server event, so it can only fire during a postback.
When you press enter, it can either be caught by the focused control (if it is a textarea, a select or a button) or by the form. If the form catches it, it will act as if the first button in the form was clicked.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi..Happy to here from you again .
The only change I made it was putting the asp:textbox in a <DIV> instead of a <table><tr><td>.
I observed when I press enter in the textbox I hear a sound(one of the windows usual sounds).
I am too late but i will never give up
|
|
|
|
|
hi all,
how to fill a value to combo in datagridview
thanks
|
|
|
|
|
if u r asking for binding the combo box then here's the code
dim con as new oledbconnection("connsctionsting")
con.open
dim ds as new dataset
dim ad as new oledbdataadapter("query",con)
ad.fill(ds)
combobox1.displaymember="fieldname"
combobox1.valuemember="fieldname"
combobox1.datasource=ds.tables(0)
|
|
|
|
|
Select Datagridview. Now Click on smart tag which is on top Right corner then select Option "Edit Column".Now select the column from selected column list which is of combo box type. Now Select Property Items(collection Type) and Press the associated button button.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
I'm not sure if this will answer your question, but the following code segment first creates a DataTable containing values for my combo box, then creates a column that is inserted into a datagrid.
Dim typeDesc As New DataTable
Dim dr As DataRow
typeDesc.Columns.Add("Indx", Type.GetType("System.Int32")) '0
typeDesc.Columns.Add("Desc", Type.GetType("System.String")) '1
dr = typeDesc.NewRow()
dr(0) = 0 : dr(1) = "Rural"
typeDesc.Rows.Add(dr)
dr = typeDesc.NewRow()
dr(0) = 1 : dr(1) = "Suburban"
typeDesc.Rows.Add(dr)
dr = typeDesc.NewRow()
dr(0) = 2 : dr(1) = "Urban"
typeDesc.Rows.Add(dr) ' datatable giving values type
newCol = New DataGridViewComboBoxColumn
newCol.Width = 90
newCol.HeaderText = "Parcel Type"
newCol.DataSource = typeDesc
newCol.ValueMember = "Indx"
newCol.DisplayMember = "Desc"
dgvTasks.Columns.Insert(2, newCol)
The dgvTasks is the name of the datagrid in which the combo will appear.
Rich Feldman
|
|
|
|