|
Take a look at the message I posted in the SQL forum. Please be kind and do not cross post
|
|
|
|
|
Now im a bit confused here. SQL-forum?
|
|
|
|
|
I need to programmatically search through email messages for a set of users on our Exchange server and make a report of and forward messages that have not been opened. Does the Exchange SDK allow this kind of programmatic access or is there a better solution? All the information I can find on the SDK is very vague.
Thanks.
-- modified at 9:35 Friday 21st July, 2006
|
|
|
|
|
Hello All,
I am developing an application using VB 2005 that will run continuously in the background on a users workstation. This application will automatically transfer files from the local machine to a remote server and vise versa. It checks for the files on a timed interval. I have two problems with this application that I am having trouble figuring out:
The first problem is that the cmd.exe shell pops up on the screen every time it maps the drive. The application needs to be completely 'invisible' to the user. I cannot have something popping up every several minutes while they are trying to work.
The second issue is that I do not want to let a continuous connection to the remote server so I have mapped a network drive to the remote server using process.start. I have provided administrative credentials when creating the drive. Local users do not have permission to connect to the remote server. Also, I only want to create the drive when necessary, and then close it when the current process is finished with it.
The drive mapping shows in My Computer when I check for it. However, when the code tries to access the drive to transfer the files, I get an error and the program shuts down.
The error is: system.unauthorizedaccess, eventtype: clr20r3.
I am assuming this has something to do with the user credentials, so I tried creating the mapped drive using the same command lines in my code using the command prompt. I was able to successfully create the mapped drive and access it under the local user account
Any ideas/help would greatly be appreciated.
This is the section of code that I am using to create the drive:
Try
srvConn = New System.Diagnostics.Process
srvConn.StartInfo.UseShellExecute = False
srvConn.StartInfo.RedirectStandardError = True
srvConn.StartInfo.RedirectStandardOutput = True
srvConn.StartInfo.FileName = ("net.exe")
srvConn.StartInfo.Arguments = "use z: \\server\share" & " " & My.Settings.rbsSrvPwd & "/user:" & My.Settings.rbsSrvUsr
srvConn.Start()
srvConn.WaitForExit()
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
Microsoft.VisualBasic.FileIO.FileSystem.WriteAllText(My.Settings.logPoll, "Error: " & ex.Message & " occurred in rbsSrvConnection:rbsConnOpen" & vbCrLf, True)
End Try
mzak0420
|
|
|
|
|
Have a look at the forum message posted at this url:
http://www.codeproject.com/script/comments/forums.asp
Named "Accessing CD Drives"
You may be able to change the code to access network drives. Namely change the format to "DriveType.NetworkDrive" depending on your needs.
Also please not the last post on this message, This will work if u are trying to run .exe files if not, use the other method.
Posted by The ANZAC
|
|
|
|
|
The link to that thread is here.[^]
Dunno if that'll work tho... I saw the networked drive item in the enum but that code wasn't written with networked drives in mind...
|
|
|
|
|
Thank you for your suggestion and I appreciate it, however it did not work.
After some experimentation, I was able to get it to work. I am posting my solution in the event that it will help someone else. There were two things I was doing wrong:
1. I did not provide a redirect for the input. Seems you need to redirect error, input, and output even if you are not using the data.
2. I was using WaitForExit in the wrong context.
Here is the code that works:
info.StartInfo.FileName = ("net.exe")
info.StartInfo.UseShellExecute = False
info.StartInfo.RedirectStandardInput = True
info.StartInfo.RedirectStandardError = True
info.StartInfo.RedirectStandardOutput = True
info.StartInfo.CreateNoWindow = True
info.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
info.StartInfo.Arguments = "use z: \\server\share " & My.Settings.rbsSrvPwd & " /user:" & My.Settings.rbsSrvUsr
Process.Start(info.StartInfo)
If anyone sees any flaws please let me know.
mzak0420
|
|
|
|
|
I'm using VB.NET 2005 Express.
I have been working on a project that on startup populates a ListView with a total of 28 ListItems. Each one has a SmallIcon and LargeIcon (the SmallIcons are taken from 5 different gifs, whereas the LargeIcons are all unique). When I was using just a couple of dummy gifs to test other features, it was fast. Now it takes about 10-15 seconds to load the images into the respective ImageLists. How could it possibly take this long to load images? VB 6 was way faster and gave me the option of designating a different key for small and large icons, now (as far as I know) I have to use the same key for both and thus unnecessarily reload copies of the same image to the SmallIcon ImageList.
I've tried all sorts of things like BeginUpdate/EndUpdate, setting ListView.SortOrder = Nothing, delinking the ImageLists from the ListView and then relinking them, etc. to no avail. Why did they make such an easy control in VB 6 so much harder to use? Sorry if this problem has been dealt with here already.
Please help!
ccliam
|
|
|
|
|
Seriously, does anyone know a quick way to add images to an image list at runtime? Both Bitmap.FromFile() and Image.FromFile() seem to be equally slow, as is New Bitmap(). The gifs I'm adding are not large so I don't get what is taking so long.
Here's the specific code that's running so slow (it gets called within a For/Next loop):
iml16.Images.Add(Image.FromFile(strSmallFilename))
iml140.Images.Add(Image.FromFile(strLargeFilename))
I've hear AddRange is faster but I won't ever know how many images there will be to load so I don't see how I could create the array.
ccliam
-- modified at 11:40 Friday 21st July, 2006
|
|
|
|
|
What code do i need to copy a selected item from a list box to clipboard
so then i could paste it into any other program that accepts text
|
|
|
|
|
Clipboard.SetDataObject(....)
|
|
|
|
|
Hey does anyone know how to send a fax using vb.net? Or maybe a third party tool that I could use to send a fax? Any help at all would be much apreciated. Thanks in advance guys(and girls also )
Pablo
www.aes4you.com
|
|
|
|
|
I have some old VB6 code that uses the Kodak Image Edit and Image Admin controls to manipulate TIFF documents; to send the fax, I used Exchange, CDO and said the address as FAX:888-888-88888 (or whatever the number is).
Have not recreated it in VB.NET, but, that may be coming...
Hope that helps...
Tim
|
|
|
|
|
Would you mind sending me the source?
Pablo
www.aes4you.com
|
|
|
|
|
I made a project that uses Language "Urdu". I want to know that how i check that Urdu is installed on the Target System.
Shahzad Munir.
|
|
|
|
|
I want to know how you add an extra button to the forms title bar. Say, for example, a minimize to tray button next to the minimize button.
Posted by The ANZAC
|
|
|
|
|
is it possible to compare date in vb???
i want to compare let said if over specific date 1/1/2005 is pass from today date then some event happen....
thanks.
|
|
|
|
|
Dim earlydate As Date, laterdate As Date, today As Date
earlydate = "1/1/2000"
latedate = "1/1/2050"
today = Now
If DateDiff("s", earlydate, today) > 0 Then
MsgBox earlydate & " comes before " & today
Else
MsgBox earlydate & " comes after " & today
End If
1fm1fu
|
|
|
|
|
Hi guys,
I am unable to reset the checked status of a Node in a treeview in vb6. I need to make some nodes readonly i.e. stop the user from changing the Node.Checked status.
Anyone knows how to do it please help.
E.g. this code does not work
Private Sub TreeView1_NodeCheck(ByVal Node As MSComctlLib.Node)
Node.Checked = False ''DOES NOT WORK ;(
''Node.Checked = Not Node.Checked ''DOES NOT WORK ;(
End Sub
1fm1fu
|
|
|
|
|
i have search around the website i just cant open the .dbf in vb, i want to insert in it using vb. anyone have any idea???
|
|
|
|
|
depending on what is in the file, you could probably just read it in using the StreamReader:
VB.NET :
Dim sFilePath as string = "C:\File.DBF"<br />
Dim sContent as string = nothing<br />
<br />
Dim Reader as new StreamReader(sFilePath)<br />
<br />
sContent = Reader.ReadToEnd()
assides that, some more info would help.
http://www.stormbase.net
|
|
|
|
|
I have found problem with send email.
Dim sendmail as smtpClient
Dim sendto as new MailAddress("webmaster@khmerfriend.com")
Dim from As New MailAddress("cheatasp@yahoo.com")
DIm sms As New MailMessage(sendto, from)
sendemail = new smtpClient("localhost")
sendmail.send(sms)
If anyone know please help me
THanks
................
|
|
|
|
|
You're very vague, explain in full grammared sentences, exactly what you are trying to do.
Posted by The ANZAC
|
|
|
|
|
I have used my code that i wrote in this forum, I want to sedn mail using vb.net 2005, but when i try it does not work.
................
|
|
|
|
|
have you seen these links:
http://www.jscape.com/articles/sending_email_using_vb.html\
http://www.codeproject.com/vb/net/epsendmail.asp
Posted by The ANZAC
|
|
|
|