|
You can not update part of a text file. You have to rewrite the entire file.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
I've created a app for monitoring Internet access on workstations. I've created the project so that the main form's visible = false, when it detects the iexplore process it sets the visible = true and prompts the user for a session password. The problem is that my apps process is running in the Task Manager and the user can stop it from there. Thus dissabling my app.
I want to create a service that runs in the background and then starts my app to prompt user for session password. Is this possible and how can I implement it. Should I create a seperate windows service that starts my app or should I incorporate the service into my app.
quinton.nel
|
|
|
|
|
Hi all,
I have a problem with file List box,
I have a code like this
Private Sub Command1_Click()
Form1.FileListBox.Path = "d:\temp"
Form1.FileListBox.Pattern = "*.lnk"
MsgBox Form1.FileListBox.List(0)
End Sub
Suppose I have a shortcut d:\temp\hai.lnk
When I click on Command1 Button
Then "MsgBox Form1.FileListBox.List(0)" will get the value "d:\temp\hai.lnk"
Then I have deleted "hai.lnk" Manually and Again Click on Command1 Button,but "MsgBox Form1.FileListBox.List(0)" again showing "d:\temp\hai.lnk"
How can I Rectify it.
Please Help Me
Thanks IN Advance
George K Jolly
|
|
|
|
|
After you delete the file, call the Refresh method on the FileListBox:
FileListBox.Refresh()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Hi Members,
I'm stuck in a project where I need to connect a scanner to a program(VB.net),i.e., on click of a button the scanner should start functioning.
How can I achieve that?
Regards,
Member.
|
|
|
|
|
TWAIN. I think there's a .NET TWAIN driver here on CP, just search for it. Either way, you need a TWAIN implimentation to talk to scanners.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks i'll try to search and implement it.
|
|
|
|
|
i want to open doc file using vb.net. word doc should open. then i want to convert it into pdf.
sai
|
|
|
|
|
Sounds like you need to look into either .NET or COM interop with Office. IT depends on what versions you want to support, the COM ones are always there, the .NET ones I'm not sure when they came out. Creating PDF, there's a couple of projects on source forge that do it, and plenty of commercial options.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How is it possible to retrieve the WMI property description field with VB 2005 / .net?
Example: for the value
<br />
root\CIMV2:Win32_PerfRawData_SMTPSVC_SMTPServer\MessageBytesTotal<br />
the Property Description is
"The total number of bytes sent and received in messages."
With this code I can get the value of "MessageBytesTotal", however how to get the description into a string variable?
<br />
Dim mc As ManagementClass<br />
Dim menge As ManagementObjectCollection<br />
Dim mo As ManagementObject<br />
Dim strTmp As String<br />
<br />
Try<br />
mc = New ManagementClass("\\MeinServer\root\cimv2:Win32_PerfRawData_SMTPSVC_SMTPServer")<br />
<br />
menge = mc.GetInstances()<br />
<br />
For Each mo In menge<br />
strTmp = mo("MessageBytesTotal")<br />
Next<br />
mc.Dispose()<br />
Return strTmp<br />
Catch ex1 As Exception<br />
console.writeline (ex1.Message)<br />
End Try<br />
Which code do I need to add to get success?
I have tried this here, but it does not work:
<br />
strTmp2 = mo("Description")<br />
Thanks for any hint and feedback!
|
|
|
|
|
AFAIK, there is no way to retrieve the property/method/event descriptions in WMI. You can retrieve the list of properties/methods, and their data types, but not the descriptions.
The only place I know to get that information is in the MOF files that were used to compile the WBEM classes. It would involving parsing those file to get the info. I don't know of an API to do it for you.
I could be wrong though...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you are realy into a bit of work, you could generate your own managed class using mgmtclassgen.exe and just add your own custom property for it.
Read on... for instructions:
The following command generates a managed class from Win32_PerfRawData_SMTPSVC_SMTPServer
mgmtclassgen.exe Win32_PerfRawData_SMTPSVC_SMTPServer /n root\cimv2 /l VB /p c:\SMTPServer.vb
The tool writes the managed class to the source file at c:\SMTPServer.vb, using the ROOT.CIMV2.Win32 namespace.
Add the file to your project.
Add the following to SMTPServer.vb somewhere near "Public ReadOnly Property MessageBytesTotal()" (about line # 2509 in my file.):
<Browsable(True), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
Description("Description of MessageBytesTotal.")> _
Public ReadOnly Property MessageBytesTotalDescription() As String
Get
Return "The total number of bytes sent and received in messages."
End Get
End Property
And/Or whatever you want the property(s) to be..
And/Or Your own overloads ect..
Have fun..
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfmanagementstronglytypedclassgeneratormgmtclassgenexe.asp
-- modified at 1:47 Friday 15th September, 2006
|
|
|
|
|
Hi,
Does anyone know how to send a pdf file to a printer without using Acrobat.
|
|
|
|
|
Without some component to load, parse and render the document, you can't send a PDF to the printer. It'll just print tons a garbage.
TallComponents[^] has a couple of things that might work for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Hello,
I am using the .Net 2003
I am using the SQL Server 2000
I am using the OleDb Connection Object
I am using the ExecuteNonQuery Method
While Inserting the records Multiple times under transaction control I am getting this Error:
System.Data.OleDb.OleDbException: Connection is busy with results for another commandat System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbDataReader.NextResult()
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
Please Give the soultion for this.
Nagarajan R.J.
|
|
|
|
|
Without seeing the code that's generating this error, it's impossible to tell you what you did wrong. Though, I get the feeling that you're trying to use a DataReader object for something it's not designed for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The code for this as follows
Dim cmdGeneral As OleDb.OleDbCommand
Private Function funInsertRecord(ByRef cnn As OleDb.OleDbConnection, ByRef trans As OleDb.OleDbTransaction) As Boolean
Try
Dim intRowIndex As Integer
Dim intResultCount As Integer
For intRowIndex = 0 To 100
Dim strSQL As String = " INSERT INTO EMPLOYEES(FirstName,LastName) VALUES('RAJ','KUMAR') "
cmdGeneral = New OleDb.OleDbCommand(strSQL, cnn, trans)
intResultCount = cmdGeneral.ExecuteNonQuery()
If intResultCount = 0 Then
funInsertRecord = False
Exit Function
End If
Next intRowIndex
funInsertRecord = True
Catch ex As Exception
funInsertRecord = False
End Try
End Function
Nagarajan R.J.
|
|
|
|
|
Well, there are multiple causes for this, including a bug in SQL Server 2000.
What is going on before you call this sub? Do you have a DataReader open on this same connection? Are you trying to work on multiple result sets at the same time, on the same connection?
MSKB Article[^]
Yahoo Results for error[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm using the Microsoft report to print customer information. I made a setup screen that allows the user to define date ranges to run the report for. Then they click print to run the report. How can I pass the date range information they have chosen to the report so that it prints at the top of every page.
|
|
|
|
|
I wonder if anyone can help me.
I am trying to display my network domain name and IP address of a PC. I have Visual Studio 2003 and running on Windows 2003 server. I am running .Net Framework 1.1
There is a new object isn .NET Framework version 2.0 that is
Imports System.Net.NetworkInformation which runs
Dim ipproperties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
But with .Net Framework 1.1 does not.
Couple of questions
1. Do I install .Net Framework 2.0 on the user PC etc remembering that I have VS 2003
2. How was this done with version 1.1 and VS 2003
|
|
|
|
|
directred wrote: 1. Do I install .Net Framework 2.0 on the user PC etc remembering that I have VS 2003
You could, but your application will not use any of the .NET 2.0 classes. You're restricted to using only .NET 1.0 and 1.1 classes if you compile under .NET 1.1.
If you're talking about getting the DNS domain name, you can get the fully qualified DNS name of the local machine using the System.Net.Dns class as it's GetHostName() method. You can then parse the string to get everything after the first period to get the domain name.
If you're talking about getting the Windows domain name, you can get the domain of the currently logged in user from the System.Environment class and it's .UserDomainName property.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
i have to read each data from a dataset
and check each value in an IF Condition
can u help me
thanks in advance
|
|
|
|