|
hai all,
is it possible to take and run vb.net windows application setup as windows service...if possible means how to take and run vb.net windows application setup as windows service....
is it possible to run the vb.net windows application setup automatically 5 mins once....if possible means...how to run vb.net windows application setup automatically...want to run 5 minutes once automatically...
thanks in advance...
|
|
|
|
|
You want to install a service and have it then run automatically ? Yes, that's easily done.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
When i run My Project there is ERROR that
Could Not load file or assambly " DriveinfoEX.dll, 1.1.3326.15292 Culture=neutral,Public key token=1 or its dependensy. the application faild to start because its side by side configration is incorrect please see the application event log for more detail(Exception from HRESULT:0x800736B1)
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|
|
Hi,
you are not the first[^] to have such problem.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
I am trying to send an email for my gmail account using SMTP code in VB.net; however, the email is not getting sent. I am using the code shown below. Kindly suggest what am I doing wrong. Thanks.
Aman
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Start by creating a mail message object
Dim MyMailMessage As New MailMessage()
'From requires an instance of the MailAddress type
MyMailMessage.From = New MailAddress("abc@gmail.com")
'To is a collection of MailAddress types
MyMailMessage.To.Add("abc@yahoo.com")
MyMailMessage.Subject = "GMail Test"
MyMailMessage.Body = "This is the test text for Gmail email"
'Create the SMTPClient object and specify the SMTP GMail server
Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Port = 465
SMTPServer.Credentials = New System.Net.NetworkCredential("abc", "cba")
SMTPServer.EnableSsl = True
Try
SMTPServer.Send(MyMailMessage)
MessageBox.Show("Email Sent")
Catch ex As SmtpException
MessageBox.Show(ex.Message)
End Try
End Sub
|
|
|
|
|
Looks reasonable to me. I'd assume the issue is something to do with gmail, and not your code, assuming your settings are all correct.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Is their anyway to Send Email in Exchange 2007 without using SMTP because client doesnot want to enable it Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
I've just tested your code on my smtp account and it works perfectly. I only removed the following cause they don't apply in my case:
' SMTPServer.Port = 465
' SMTPServer.Credentials = New System.Net.NetworkCredential("abc", "cba")
' SMTPServer.EnableSsl = True
|
|
|
|
|
Hassan, could you please share what number did you use for the port and what did you use for SMTPServer.EnableSsl!!
Thanks,
Aman
|
|
|
|
|
The port number for Gmail's SMTP is 587 , i think that is the problem following is the code i am using in my application and it works
Dim smtpClient As New Net.Mail.SmtpClient()
Dim mail As New Net.Mail.MailMessage()
'create the message to be sent
mail.To.Add("test@test.com") ' Enter the Email of the person you want to send the mail to
mail.From = New Net.Mail.MailAddress("username@gmail.com", "Your Display Name") ' Enter Your email address
mail.Subject = "Test Message"
mail.Body = "This is a test message"
' Prepare the client to send the above message
smtpClient.Host = "smtp.gmail.com"
smtpClient.EnableSsl = True
smtpClient.Port = 587
smtpClient.Credentials = New Net.NetworkCredential("username@gmail.com", "password") 'Enter username and password of the account , you want to use to send mail
smtpClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtpClient.Send(mail)
|
|
|
|
|
I have a macro in Excel VBA.
I was running it by hot-keying it to control q, but now that all other things are up and running live, I wanted to perform the macro immediately upon opening the file.
No Problem, I thought, I would just move the macro to Private Sub Workbook_Open () / End Sub and that would be it.
Alas not.
I have no problem, I just put a Call in there instead, but I was wondering why I couldn't cut and paste the stuff in and expect it to work!
Am I missing something basic? (no pun intended)
------------------------------------
"Your manuscript is both good and original. But the part that is good is not original, and the part that is original is not good."
Dr Samuel Johnson
|
|
|
|
|
I have an Excel spreadsheet which contains some dates that need to be converted using the function JDE2Date. It appears to work - but i get a runtime erroe 1004 Application-defined or object defined error on row 18,059. The value of the cell shows as -699947. My application crashed there. Any Ideas?
Private Sub Worksheet_Activate()
Dim rowcount As Long
For rowcount = 2 To Me.Rows.Count
Dim value As String
value = Range("D" & rowcount).value
Range("D" & rowcount).value = JDE2Date(value)
Next
rowcount = 0
value = ""
For rowcount = 2 To Me.Rows.Count
value = Range("E" & rowcount).value
Range("E" & rowcount).value = JDE2Date(value)
Next
End Sub
Public Function JDE2Date(ByVal plngDate As Long) As Date
' This Function takes a JDE Julian Date and Converts it to a Microsoft Date
Dim lngYear As Long
Dim lngDay As Long
Dim dtFirstDayOfYear As Date
' Calculate Date
lngDay = plngDate Mod 1000
lngYear = ((plngDate - lngDay) / 1000) + 1900
dtFirstDayOfYear = CDate("1/1/" & lngYear)
lngDay = lngDay - 1
JDE2Date = dtFirstDayOfYear + lngDay
End Function
|
|
|
|
|
Well, the function works. What's the data that it's trying to convert?? The number you supplied does convert to a date, but in the year 1198.
|
|
|
|
|
hi.......
i did one project in vb.net.....i used crystal report and crystal report viewer to generate report...... while running one error occurred like this......" load report failed ..... how to solve this error......
|
|
|
|
|
Any more details on that error message?
Is the .rpt file existing?
Tosch
|
|
|
|
|
see this routine...this routine is loading all albums and photos in from database in to tree view control
[code]
Public Sub LoadAlbums()
enlarge()
Dim i As Integer
lblAlbum.Visible = True
ProgressBar1.Visible = True
For i = 1 To 100 Step 6
ProgressBar1.Value = +i
Dim objAlbums As New Albums()
treeAlbum.Nodes.Clear()
Using oReader As SqlDataReader = objAlbums.GetAlbumsAndPhotos()
Dim AlbumNode As TreeNode
Dim PreviousAlbumID As Integer = 0
Dim CurrentAlbumID As Integer = 0
Dim AlbumDesc As String
Dim AlbumName As String
Dim PhotoName As String
Dim PhotoID As Integer
Dim PhotoData() As Byte
Dim PhotoDesc As String
Dim iAlbumId As Integer
Dim iAlbumDesc As Integer
Dim iAlbumName As Integer
Dim iPhotoID As Integer
Dim iPhotoName As Integer
Dim iPhotoData As Integer
Dim iPhotoDesc As Integer
Try
Dim imgList As New ImageList()
'Add image to represent an Album from resources
Dim albumImg As Image = My.Resources.IMG
imgList.Images.Add("Album", albumImg)
imgList.ColorDepth = ColorDepth.Depth32Bit
treeAlbum.ImageList = imgList
iAlbumId = oReader.GetOrdinal("AlbumID")
iAlbumDesc = oReader.GetOrdinal("Album_Desc")
iAlbumName = oReader.GetOrdinal("Album")
iPhotoID = oReader.GetOrdinal("PhotoID")
iPhotoName = oReader.GetOrdinal("Photo")
iPhotoData = oReader.GetOrdinal("PhotoData")
iPhotoDesc = oReader.GetOrdinal("Photo_Desc")
While oReader.Read()
CurrentAlbumID = oReader.GetInt32(iAlbumId)
If CurrentAlbumID <> PreviousAlbumID Then
AlbumName = oReader.GetString(iAlbumName)
If oReader.IsDBNull(iAlbumDesc) Then
AlbumDesc = ""
Else
AlbumDesc = oReader.GetString(iAlbumDesc)
End If
AlbumNode = AddAlbumToTree(AlbumName, AlbumDesc, CurrentAlbumID)
End If
PreviousAlbumID = CurrentAlbumID
PhotoID = oReader.GetInt32(iPhotoID)
PhotoName = oReader.GetString(iPhotoName)
PhotoData = DirectCast(oReader.GetValue(iPhotoData), Byte())
If oReader.IsDBNull(iPhotoDesc) Then
PhotoDesc = ""
Else
PhotoDesc = oReader.GetString(iPhotoDesc)
End If
AddImageToTree(AlbumNode, PhotoName, PhotoID, PhotoDesc, PhotoData)
End While
btnNewAlbum.Enabled = True
mnuNewAlbum.Enabled = True
Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
oReader.Close()
End Try
End Using
Next
Application.DoEvents()
lblAlbum.Visible = False
ProgressBar1.Visible = False
End Sub
[/code]
i want to run a progress bar as long these photos are being loaded i want that progress bar should work
i m doing as
[code]
For i = 1 To 100 Step 6
ProgressBar1.Value = +i
[/code]
but this is loading albums and photos again and again
i want that it should be work perfectly
how can i achieve above task using a progress bar or can i do that through marquee progress,if yes then how??
thanks
Aamir Mustafa
|
|
|
|
|
Aamir Mustafa wrote: but this is loading albums and photos again and again
Of course it is, you have put your load in the for loop:
For i = 1 To 100 Step 6
ProgressBar1.Value = +i
Dim objAlbums As New Albums()
treeAlbum.Nodes.Clear()
Using oReader As SqlDataReader = objAlbums.GetAlbumsAndPhotos()
etc
next
To make your progress bar work properly you need to update it in the reader bit:
While oReader.Read()
do all your code and update progress bar
You may want to consider a background thread to keep the UI responsive.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Look at this picture:
http://img24.imageshack.us/img24/4117/clipboard02ca4nj6.png
My usercontrol has its own designer, which inherits from Windows.Forms.Design.ControlDesigner.
Maybe i can override some properties or something? :P
|
|
|
|
|
Sub ShutDown(sNodes, sAction)
Dim sNode, oWMI, colOperatingSystems, obj, oOS, iCMD, nERR, objShell
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8
For Each sNode In Split(sNodes, ",")
Set oWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & sNode & "\root\cimv2")
Set colOperatingSystems = oWMI.ExecQuery("Select * from Win32_OperatingSystem")
For Each obj In colOperatingSystems
Set oOS = obj: Exit For
Next
sAction = LCase(sAction)
Select Case sAction
Case "logoff"
iCMD = EWX_LOGOFF
Case "logoff_force"
iCMD = EWX_LOGOFF + EWX_FORCE
Case "shutdown"
iCMD = EWX_SHUTDOWN
Case "shutdown_force"
iCMD = EWX_SHUTDOWN + EWX_FORCE
Case "reboot"
iCMD = EWX_REBOOT
Case "reboot_force"
iCMD = EWX_REBOOT + EWX_FORCE
Case "poweroff"
iCMD = EWX_POWEROFF
Case "poweroff_force"
iCMD = EWX_POWEROFF + EWX_FORCE
Case "hybernate"
On Error Resume Next
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "%windir%\System32\rundll32.exe PowrProf.dll,SetSuspendState"
self.Close
exit sub
Case Else ' Default value
iCMD = EWX_POWEROFF
End Select
Next
oOS.Win32shutdown cint(iCmd),cint(0)
End Sub
Hi,
I use this code to shutdown and reboot my PC. However logoff and poweroff will not work on an windows XP. This code came from MS.
Someona has an idee to solve this?
Ths code must be in script
Jan
|
|
|
|
|
I had a problem when you shut-down the PC it did not power off. This was related to the incorrect power management settings in the BIOS.
Would that have anything to do with it?
Cheers,
|
|
|
|
|
I don't think so. My settings are fine and the PC start up fine on the other options
|
|
|
|
|
jan212r wrote: oOS.Win32shutdown cint(iCmd),cint(0)
This line returns a value that you're not picking up. What's the returned value??
|
|
|
|
|
Becourse I don't need that value(normely the pc must close) I did not program it however it gives 6a6 (1702) as error
|
|
|
|
|
First, shouldn't that Win32Shutdown line be above the Next statement it's sitting under??
jan212r wrote: Becourse I don't need that value(normely the pc must close)
Well, obviously you do, because it's returning an error that you can use to try and diagnose this. That error code is that the binding handle is invalid. This leads me to believe that either the account you're running this code under doesn't have sufficient permissions on the remote PC to shut it down (there is a privilege listed in the Win32_OperatingSystem documentation) or there is a problem with the WMI installation on those machines.
|
|
|
|
|
how can i check an 8 bit hexadecimal number in a textbox bit by bit??..txx
hv a nice day!!!
|
|
|
|