|
Why not load image-magick (I think thats how it is spelt) you can call it by launching the process and controlling the IO devx has a great article on launching and controlling processes.
|
|
|
|
|
I have the following code but the exception occurs : System Failure sending message. What should i do, the code is:
Imports System
Imports System.Net.Mail
Public Module Module2
Sub Main()
Dim EmailTo As String 'Emailaddres for user to send
Dim EmailFrom As String 'Emailaddres for user from
Dim MailSubject As String 'Subject of Mail
Dim MessageBody As String 'Message
Dim ServerName As String 'Server Name - important
'Add in EmailTo, EmailFrom etc parameters here
EmailTo = "<email to>"
EmailFrom = "<email from>"
MailSubject = "<Subject Line>"
MessageBody = "<This is the email>"
ServerName = "<servername>"
'Set the SMTP Server's address
Dim myClient As New smtpClient(ServerName)
'Enclosed within Try-Catch block to catch exceptions in case of errors
Try
myClient.Send (EmailFrom, EmailTo, MailSubject, MessageBody)
Catch ex As Exception
MsgBox ( "Delivery Failure: " & ex.Source &" for " & ex.Message )
End Try
End Sub
End Module
Thank you.
Khurum
|
|
|
|
|
I came here to post a question about email myself. From what little I have learned about it so far, I would check the Send() function to see what it expects for arguments. If they are all strings then I have no idea, but if some of them are supposed to be objects maybe a string is not a valid substitue for that type of object. For example, EmailTo may be an array or object capable of containing multiple addressees.
>>>-----> MikeO
|
|
|
|
|
Here is an example of what a working email sub looks like:
Dim objMail As New System.Net.Mail.MailMessage
Dim ToAdd As New System.Net.Mail.MailAddress("to@email.com", "Recipient Name")
Dim FromAdd As New System.Net.Mail.MailAddress("from@email.COM", "Sender Name")
'The subject of the message
objMail.Subject = "Request for Mathching Funds Grant"
' The message text
objMail.Body = "Body Message Here"
objMail = New System.Net.Mail.MailMessage(FromAdd, ToAdd)
'Add a carbon copy recipient.
'MailAddress copy = new MailAddress("Notification_List@contoso.com");
'message.CC.Add(copy);
'Set up the client
Dim objClient As New System.Net.Mail.SmtpClient
objClient.Host = "smtp.host.com"
objClient.Send(objMail)
Sorry i'm too tired to dissect your code, but this code should get you on the right path
Nathan Lindley
.NET Aficionado
|
|
|
|
|
Thanks very much for your help.
I tried running your code with the relevent details changed; to/from addresses and the exchange server name(smtp.server.com).
However the code runs but no emails are received.
I have an exchange environment, and am new to programming, what can i do??
Cheers
Khurum
|
|
|
|
|
What I want to do is look at a file on a remote computer and get it's Product Version (not file version).
The code that I'm using to get this is:
productVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo("\\" & compName & "\C$\Progra~1\Mozill~1\firefox.exe").ProductVersion
This works fine if I'm logged in with my Domain Admin account. But I want to be logged in as a user instead of an admin. How do I send my Domain Admin credentials along with the file info request?
In this specific instance, the Product Version isn't located in the registry or (as far as I can tell) in anything that WMI can report. I know how to pass credentials when accessing remote WMIs, just not with file system requests.
Been stuck on this problem for over a week. Please help.
Thank you,
Chris
|
|
|
|
|
I am working on a Finger Print terminal's PC connectivity software. I am using an OCX provided by the hardware manufacturer. Till now I am able to connect to the device and read user IDs. But the problem is with reading finger print data from the device and converting it to bitmap or any other image format. Manufacturers have provided a sample application in Delphi. I am created the similar VB application by understanding its different function. A function in which the data is being read from the device is -
function TForm1.BackupFinger():integer;<br />
var<br />
bRet:boolean;<br />
iRet:integer;<br />
jh:integer;<br />
dwMachineNumber,dwEnrollNumber,dwEMachineNumber,dwBackupNumber:integer;<br />
d1,d3:longint;<br />
buf: array[0..800] of longint;<br />
m:TMemoryStream;<br />
begin<br />
jh := StrToInt(cbJh.Text);<br />
d1 := 0;<br />
d3 := 0;<br />
dwMachineNumber := jh;<br />
dwEnrollNumber := qfp.FieldByName('dwEnrollNumber').Value;<br />
dwEMachineNumber := qfp.FieldByName('dwEMachineNumber').Value;<br />
dwBackupNumber := qfp.FieldByName('dwBackupNumber').Value;<br />
bRet := FPKeeper1.GetEnrollDataB(dwMachineNumber,dwEnrollNumber,dwEMachineNumber,dwBackupNumber,d1,buf[0],d3);<br />
if bRet = true then<br />
begin<br />
m := TMemoryStream.Create;<br />
m.Position := 0;<br />
iRet := m.Write(buf,800);<br />
qfp.Edit();<br />
qfpdwEnrollData.LoadFromStream(m);<br />
qfp.FieldByName('dwPassWord').Value := d3;<br />
qfp.FieldByName('Memo').Value := 'Backuped';<br />
qfp.Post();<br />
m.Free;<br />
BackupFinger := 1;<br />
end<br />
else<br />
begin<br />
BackupFinger := 0;<br />
end<br />
end;
Its obvious that data is being read and stored in Access Database. Now, I don't know what type in VB I should create for TMemoryStream. Also any idea how to convert this data into any image format will be very helpful.
|
|
|
|
|
Hi,
Please how do set papersize irrespective of printer type.
And also I want to set the endof the document such that if a paper of double the papersize is set on the print 2 copies will printed on the paper.
When shld I use the Newpage method.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
Hi to all you coders out there
I'm relatively new to all this and I'm presently using Visual Studio 2005 with VB.NET and ASP.NET. I'm designign a web application using ASP.NET.
Hopefully what I'm asking is simple (just not to me!). I want some sample VB.NET code to print an exisintg document to a specific printer. I know this has changed alot from VB 6 which I had used before. In the example take the following parameters:
document name and path: C:\Upload\report.pdf
printer name: OfficeJet85
I really hope to hear from some of you! Thanks in advance!
Dave
|
|
|
|
|
I don't believe you can start a printer in ASP.NET, the user has to do it in the browser.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian
Thanks for your reply.
Can I do it using VB.NET?
Dave
|
|
|
|
|
If you're not using ASP.NET. The problem is that ASP.NET runs on the server and generates HTML for a browser. If you're writing a winforms app, then you're running on the machine you want to print on, that's fine. HEaps of tutorials on the web.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Guys,
Quick one (yeah I smell that too )
I got this pimped out treeview that handles drag'n'drop by itself etc.
It raises 'Before...' events during the d&d cycle because i want to be able to disallow some actions based on the node being affected.
This way I can have much cleaner code and all checks in the actual app will be kept to a minimum.
Now, the problem is that if i choose to cancel an action based on the data the 'Before' event passes to it's handler I need to do something like:
<br />
Sub ...(Node as TreeNode)... handles MyTreeview.BeforeNodeDrag<br />
<br />
if Node ...... then<br />
'I set a custom property of the treeview<br />
'the tree will check the .Allowdrag before it executes DoDragDrop<br />
MyTreeview.AllowDrag = False<br />
....<br />
end if<br />
<br />
end sub<br />
Once the control is passed back to the tree's d&d events drag will be terminated. This works fine and is rather clean too.
BUT
I want to know how I can pass a param back to the treeview with the one of the BeforeNodeDrag params.
For instance, If you look at the QueryCountinueDrag event in a treeview there e.Action can be set to Cancel and once the procedure is exited d&d is aborted.
Can this be done?
Thanking in advance
Regards
Alex
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
Anyone?
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
This can be done only if the control supports it. Since we nothing of the controls you're using (it's not Microsoft's) there's no way to tell if it does.
Basically, it would work just like, say, the Form's Closing event. There is a CancelEventArgs object that is sent to the event handler your write. If you want to cancel closing the form, you set its Cancel property to True sometime before control is passed back to the event source.
Private Sub Form1_Closing(sender As Object, e As CancelEventArgs) Handles MyBase.Closing
' Cancel the Closing event from closing the form...
e.Cancel = True
End Sub
You MAY be able to add this support if you create your own version of that treeview control and override the sub that raises this event, if there is one. You'd have to provide the new custom event code and the code to handle the parameter you want to pass. But it depends on the control and what you want to do with that data your passing back.
For example, in the Form class, there's a sub called OnLoad that raises the Load event that you handle in your code. You'd have to override the OnLoad sub if you wanted to do something different, like what you're talking about, passing a parameter back to the OnLoad sub.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It's a pain but it seems like the right way to solve the issue.
Thanks a lot for the tip Dave
Regards
Alex
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
Hi !!
I have a software developed using VB 6.0 and SQL server 2000.During the development stage we gave (hard coded) the server name as "SERVER1".But when I ran the same project on another m/c the DB doesn't get connected.The other m/c is having local SQL server.
What will be the problem.Whether I'll have to change the code or the SQL server settings or both.
Plz help me out.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
Hi All
Windows operating systems are allowed to create zip archives without having WinZip installed.
Do you know a way to create them using .Net 2.0?
I thought that can be possible using GZipStream and DeflateStream classes; I tryed, but no success.
How can we do them?
Regards Manustone
<br />
Imports Microsoft.VisualBasic<br />
Imports System<br />
Imports System.IO<br />
Imports System.IO.Compression<br />
<br />
Module TestZip<br />
Sub Main()<br />
Console.WriteLine ("*** TEST ***")<br />
<br />
try<br />
dim fs as FileStream<br />
<br />
fs = new FileStream( "FileToZip.txt", FileMode.Open, FileAccess.Read, FileShare.Read )<br />
dim bs(fs.Length - 1) as Byte<br />
fs.Read( bs,0,bs.Length )<br />
fs.Close<br />
<br />
fs = new FileStream( "FileZipped.zip", FileMode.Create )<br />
dim gz as GZipStream<br />
gz = new GZipStream( fs, CompressionMode.Compress,true )<br />
gz.Write( bs,0,bs.Length )<br />
gz.Flush()<br />
gz.Close()<br />
<br />
catch ex as Exception<br />
Console.WriteLine( ex.Source )<br />
Console.WriteLine( ex.Message )<br />
end try<br />
<br />
End Sub<br />
End Module<br />
|
|
|
|
|
Hi,
I have some webservice running on windows 2003 machine over SSL (Does not require client certificate. SSL, just to encrypt the data).
I made a client in VB6 which uses Soap Toolkit 3 to access the webservice.
Everything works fine if I use the client on windows2003 or windows XP machine. Client can deal with the webserice using "https" URL.
But, when I tired running the client over win2000 machine, it gave me following error.
---
Connector:Unspecified HTTP error. HRESULT=0x800A1518 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1518 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1518 - Client:Unspecified client error. HRESULT=0x800A1518
----
Then I changed the code so that it references the webserice with "http". It worked.
Then what I figured out is..
On win2000 machine when I wrote the url with "https" in browser, I got security warning "u r about to see secure item". This warning was not seen when I wrote the URL in win2003 and XP. So, I think the Soap Toolkit can not deal with that security warning?
Can anybody tell me how to solve this?
Any help will be appreciated.
- PPT
|
|
|
|
|
I had a Question I was hoping you might be able to help me with.
I am using VB.NET 2005 express and I have a list box that is bound to a table in a dataset. I want to be able to select one of the items in the list box and then use an item that corresponds to this item in the list box and I do not know how to do this.
For example, if I had a table named Person and this table had two fields one named PersonID (which is the key field), PersonName, and PersonAge. Say I had PersonName bound to the list box. So say I click on one of the PersonNames in the list box and then wanted to use the PersonAge, which corresponded to the name I had clicked, in a calculation. How would I access the PersonAge value?
I appreciate any help you could give me.
Thanks
|
|
|
|
|
Bind your datatable like this:
ListBox1.DisplayMember = "PersonName"<br />
ListBox1.ValueMember = "PersonAge"<br />
ListBox1.DataSource = dtMyDataTable
And then refer to the ListBox1.SelectedValue to get the person's age.
Hope this helps.
|
|
|
|
|
|
Probably permissions, although you don't provide a lot of info. Can you read the file normally ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello,
I thought I had this resolved.
The problem is this. I have deployed a program in the folder where the setup file is, I have a folder called CodeRed_1_0_0_10, inside that folder I have a file called CodeRed.exe.config.deploy. I want to be able to access this file.
The path is this:
C:\Deployed_4_10_06\CodeRed_1_0_0_10.
The setup.exe file is located in the Deployed_4_10_06 folder. I thought by using application.startuppath would point to this directory. However, after checking I found out that is points to this one below:
C:\Documents and Settings\yasin\Local Settings\Apps\2.0\YDBGO2AL.YA3\TOMO6HER.GJR\code..tion_53e3de40adb22891_0001.0000_adfb41cfb825f353
I thought by using this:
path = Application.StartupPath & "\CodeRed_1_0_0_11\" & "CodeRed.exe.config.deploy"
I would be able to update my file, but cannot not.
Is there a way to be able to point to the file where the setup.exe is located?
Many thanks in advance,
Steve
|
|
|
|
|
i'm trying to develop an addin for vb.net that allows the user to add a new (code created) class to the solution by right clicking on the solution in solution explorer and selecting a new context menu item from the list. this code will be dynamically generated based on some user input so cant be created by using a wizard.
i've been able to generate the class dynamically and add it to the solution etc. the one thing i havent been able to figure out is how to create the menu item so that it only appears when a "solution" type node is selected in the solution explorer window.
any help in this area would be appreciated
thanks in advance
swampy
|
|
|
|