|
hi all
i want to develop a windows service in which the application will run at the back end when the system starts..
i ve vs.net 2003 and windows xp professional version 2002 service pack 2 in my system..
can it be possible....???
any help in this regard will be highly appreciated..
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
Yes, of course it's possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Of course it's possible. All you have to do is create a Windows Service project and code the thing correctly.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to send an email through vb6.0 coding.
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
|
'Developed by: Vusi Nsibande
'Send Mail using VB in Lotus Notes
'Reference to : Lotus Domino Objects
'***********************************
'Notes variables
Dim dbDir As NotesDbDirectory
Dim n_Session As New NotesSession
Dim ndb_MailFile As NotesDatabase
Dim ndoc_Memo As NotesDocument
Dim ndoc_Col As NotesDocumentCollection
Dim nrtf_ItmBody As NotesRichTextItem
'VB strings
Dim strErr As String
Dim SendTo As String
Dim m_Subject As String
Dim m_Body As String
Dim m_attachment As String
Dim pwd As String
Dim Pos As Integer
Dim attDir As String
Dim AttPathOnly As String
Private Sub cmdLogin_Click()
On Error GoTo ErrorHandler
pwd = txtPass.Text
If pwd = "" Then
MsgBox "Please enter your e-mail password", 48, "Password required"
Exit Sub
End If
' Put your password in the quotes below to skip prompting
n_Session.Initialize (pwd)
' Either SendTo, CopyTo, or BlindCopyTo is required.
If (txEmail.Text = "") Then
MsgBox "Recipient e-mail address is required", 48, "Address required"
Exit Sub
End If
Set dbDir = n_Session.GetDbDirectory("\\MailServer\") '("C:\Lotus\Notes\Data\")
Set ndb_MailFile = dbDir.OpenMailDatabase()
' Generate an error if previous attempts were unsuccessful.
If ndb_MailFile Is Nothing Then
MsgBox ("Mail file not open"), 48, "Invalid file"
Exit Sub
End If
Dim NFiles As Integer
Dim Path As String
Dim OutFiles As Variant
Set ndoc_Col = ndb_MailFile.UnprocessedDocuments
Set nDoc = Collection.GetFirstDocument
Path = "C:\Detached\"
OutFiles = ""
NFiles = GetAllAttachments(Doc, Path, OutFiles)
SendTo = txEmail.Text
m_Subject = "Mail from Notes Using VB6.0"
' Create a new memo document.
Set ndoc_Memo = ndb_MailFile.CreateDocument
Call ndoc_Memo.AppendItemValue("Form", "Memo")
Call ndoc_Memo.AppendItemValue("From", n_Session.CommonUserName)
Call ndoc_Memo.AppendItemValue("SendTo", SendTo)
Call ndoc_Memo.AppendItemValue("Subject", m_Subject)
Me.Caption = n_Session.CommonUserName
Set nrtf_ItmBody = ndoc_Memo.CreateRichTextItem("Body")
'Body text
nrtf_ItmBody.AppendText (m_Body)
'This is where you can add support for attachments.
m_attachment = attDir
If m_attachment = "" Then
'No attachment
Else
Call nrtf_ItmBody.EmbedObject(EMBED_ATTACHMENT, "", m_attachment) 'attaches the file to the body field
End If
' Send the document.
ndoc_Memo.Send (False)
MsgBox "Mail Sent with Attachment " & m_attachment
Exit Sub
ErrorHandler:
If Err.Number = -2147217504 Then
strErr = "Passwords are case sensitive - be sure to use correct upper and lower case."
MsgBox "Notes Error: Wrong Password." & vbCrLf & strErr, 16, "Err No. " & Err.Number
Else
strErr = Err.Description
MsgBox "Notes Error: " & vbCrLf & strErr, 16, "Err No. " & Err.Number
End If
Err.Clear
End Sub
Hope this Helps
|
|
|
|
|
Dim rsMail As ADODB.Recordset
Dim rsDbr As ADODB.Recordset
Dim rsDATE As ADODB.Recordset
Dim OutApp As Outlook.Application
Dim OutMsg As Outlook.MailItem
Dim OutRecip As Outlook.Recipient
Dim OutAttach As Outlook.ATTACHMENT
'References:
Microsoft Outlook Object 8.0 Library
Microsoft ActiveX Data Object 2.x Libray
Public Sub sbrSendMail(ByVal mTemplate As Boolean)
On Error GoTo MailErr
Screen.MousePointer = 13
'Create the Outlook sessionand logon
Set OutApp = CreateObject("Outlook.Application")
Set OutMsg = OutApp.CreateItem(olMailItem)
With OutMsg
'Open sql file for email addrs
Set rsMail = New ADODB.Recordset
sQry = "Select email from arcserve_mail where runapp ='dbr' or runapp ='yn'"
rsMail.Open sQry, gcnAdo
Do While rsMail.EOF <> True
' Add the To recipient(s) to the message.
Set OutRecip = .Recipients.Add(rsMail!email)
OutRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = mlSub
.Body = fldH & vbCrLf & dfCust & vbCrLf & vbCrLf & vbCrLf _
& vbCrLf & "Report DATE: " & Now
.Importance = olImportanceHigh
If rsMail.EOF = True Then Exit Do
rsMail.MoveNext
Loop
'Resolve each Recipient's name.
For Each OutRecip In .Recipients
OutRecip.Resolve
Next
' Should we display the message before sending?
If mTemplate Then
.Display
Else
.Save
.Send
End If
End With
rsMail.Close
DestroyRefs True
Screen.MousePointer = 0
'Notify the user
alMsg = "Mail sent succesfully!"
Exit Sub
MailErr:
MsgBox "Error: " & Err.Description, 16, "Mail Err"
Err.Clear
End Sub
Public Sub DestroyRefs(Ref As Boolean)
'Release all references
Set rsDbr = Nothing
Set rsMail = Nothing
Set OutApp = Nothing
Set OutAttach = Nothing
Set OutMsg = Nothing
Set OutRecip = Nothing
End Sub
When using Microsoft Outlook the code shown above will work perfectly. Just make sure to add the two references.
|
|
|
|
|
Is there any way to generate macros for web page icluding link,textbox,button etc.
abc
|
|
|
|
|
How to record web page link, button etc with .net. It is possible to automatic generate record code on any click on web page
abc
|
|
|
|
|
What is it you want to do ? Record your actions on a web site ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to record action of web page like requesting of url, input in textbox, click on button. Record action should generate .net code. So next time I only run record action which save my time to do navigation from scratch
abc
|
|
|
|
|
If saving time is what your're after then forget recording actions and look at caching[^].
|
|
|
|
|
I already answered this. There is NOTHING that will watch you surf the web and generate VB.NET code to duplicate what you did.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How to Decrypt string which has been encrypted using SHA256
Thanks
|
|
|
|
|
It's a hash, so you can't. The hash doesn't contain all the data found in the original string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
you can break the hash using bruteforce or tables method.
if you want to bruteforce the hash, you better have a real good processor and lots of patience, because it's going to take too long(months/years)...
tables are lot faster but i dont know anyone that have sha256 tables (maybe NSA ^^)
anarchy will bring us order
|
|
|
|
|
Sir,
In C++ exe we knows that there is a main() .So Window knows where to execute the code in the c++ output exe, I mean there is a starting point , that is the execution will take place from the main().Now my queston is , In the Vb.Net What is the starting point.I mean From which point the exe will execute the code.
Thanks.
|
|
|
|
|
static void Main
The trouble is, VB.NET hides this from you by default, I believe, and just generates the code behind the scenes to run your main form. But, you can make this method visible, so you can change it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sir,
Thank you very much for ur kind attention.
I want to ask one more thing.How can i make that static void main function visible.
Thanks
|
|
|
|
|
Sorry, if I knew, I'd have told you. Just adding it explicitly may do the trick.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I hav developed a application which has to access the database from a centralized location(Server).
The Connection String i was using before to access the DB from the same(local) computer was...
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\xx\xx.mdb;Jet OLEDB:System Database=system.mdw;"
The Connection String i am using now to access the DB from the server is...
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath("\Leave\Leave.mdb") & ";"
But an error is raising...as
ERROR - - - - - -> Name Server is not declared.
I had used namespaces ->
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
Is there any other namespace tobe provided.
(Or)
Is it any other problem.
Plz help...
Jats
|
|
|
|
|
Jats_4ru wrote: ERROR - - - - - -> Name Server is not declared.
Herer[^] is the info you need.
The method is in System.Web, and if you don't have that, you probably are not within a web app. The client can't use this to map to the server, how does it know where the server is ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Thankx Christian.
Actually i am a bit new to .NET
Can you plz guide me how to Convert the present application developed in VB.NET to Web app.
-- modified at 0:48 Thursday 19th October, 2006
Jats
|
|
|
|
|
Hi,
Well, I'm currently taking an introduction to visual basic class, just to let you know what kind of person I'm am if that's any help.
Anyway, I'm trying to study for the SAT's and focus on my regular class work as well. One of my teachers suggested going to this site:
http://www.collegeboard.com/apps/qotd/question
Basically, CollegeBoard posts a new SAT question of the day each day.
Since I normally don't have time to go on the computer every sing day, I was thinking of devoloping an application that would go to that link, copy and past the question and answer, and storing it into a SQL server database all with one click or something. I don't really know where to start, and I don't really know how to do it. (I only know the really raw basics). Sorry if I posted this in the wrong section or something, maybe this program can better be written in another language? I don't know any other language besides a few of visual basic, sql, and asp.net. And I code in Visual Studio 2005.
Sorry if I sound stupid...
Thanks,
Justin
|
|
|
|
|
I had a look at that site & I don't think it's possible as they don't offer any RSS feeds or other web services.
Why don't you subscribe to their email service instead? It'll be way easier.
|
|
|
|