|
Unless specific server takes to defaul the Windows registry?
Fulvio
|
|
|
|
|
Your question still doesn't make any sense at all. You might want to have someone else convert your Italian question into English so we can understand it.
|
|
|
|
|
If i don't put the server name in smtp.server
take the default server of user ???
|
|
|
|
|
There is no "default server". If you don't tell it the SMTP server to use, your message doesn't get sent.
|
|
|
|
|
Member 1996543 wrote: take the default server of user
No. Rather the CLR would resort to its default behavior when something goes wrong. That is:
"Throwing an exception to the user ".
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi,
I have a small problem with folder deletion from a VB application.
It's a bit long, so bare with me.
I have a form that upon its initialization a folder is created using MkDir.
When the form unloads, in its Terminate event the folder is being deleted using RmDir.
in between, temporary files are written in to the folder, and deleted from it.
My problematic scenario is this:
1. the folder is created.
2. files are written.
3. files are deleted.
and here is where the problem starts:
on one computer (debug computer), the RmDir throws an exception of access denied, because a process is locking the folder, but I ignore this error, and when I load the form again, I ignore the error the MkDir throws, and everything seems to work fine (except for the fact that the folder isn't deleted).
on another computer (which also happens to be the QA, and thus really important), again the folder is not deleted (I don't know if there is an error or not - can't debug), but it is also not accessible anymore. Since it is not accessible, when I re-load the form and try to create the folder again, I get an error. The folder is in limbo. when i close the application (and its process dies) the folder is deleted.
my two main goals are
a) figure out why the computers are behaving differently
b) figure out a way to find out what locks the folder, and release the lock.
The only workaround we found, was not to create the same folder each time , but that requires a lot of code changes to VB code as well as C code, as well as not prevent accumulation of temporary folders in my system, both of which I would like to avoid.
Any help would be amazing.
Thanks.
P.S. - in case it was not clear - this is VB6 code.
|
|
|
|
|
soporificeffect wrote: the RmDir throws an exception of access denied, because a process is locking the folder, but I ignore this error
Do you have a command prompt open or a DOS-based app running with this folder as the current directory?? A Windows process cannot "lock" the folder itself, only the files in it. If there is a file in that folder that is open, you cannot remove the folder that contains it, be it a DOS or Windows process.
Is the folder empty when you try and RmDir it?? There can be no files in it when you do this.
Do you have a virus scanner running, indexing service, or something else going on "behind the scenes"?? Disable it and try your app again.
modified on Tuesday, December 04, 2007 2:11:25 PM
|
|
|
|
|
I delete all the files before I try to remove the folder. the folder is empty.
there are no applications using this folder.
I'm not sure what services run in the background, but it is not possible to disable them.
All this also does not explain how on the second computer the folder ends up in "Limbo", I can see it in the windows explorer, but I can't access it, it's as if the RmDir hasn't finished running, because the second the app closes the folder is gone
|
|
|
|
|
Is there a way to verify what the "Date Modified" date is for a document in Windows? I want to import a report, but I don't want to import it if it bombed overnight so I want to make sure the Date Modified is today's date. Any ideas?
|
|
|
|
|
You can try using the DateLastModified property of the File object(FileSystemObject).
|
|
|
|
|
Dim fi As New System.IO.FileInfo("C:\myfile.txt")
MessageBox.Show(fi.LastWriteTime.ToString("dd/MM/yyyy"))
Daniel Minnaar
Lead Software Developer
|
|
|
|
|
I could not find a VBA forum on here so figure this is the closest forum.
I have an excel doucment, here is kinda what I want to do:
- I have a value entered from an input box (Y), i want to
- If Column A (X (would start at 1)) contains (Y) then Highlight (or select whatever it is)
- Make x + 1 to go onto the next row to check
- Loop until end to ensure all records are checked
- Copy the selected files (already sorted this bit)
This is probably really simple but im new to VBA, help!
Cheers
|
|
|
|
|
Hello!
I have a Form containing a Panel. This Panel contains 3 RichTextBox Controls with some RTF Text in them. My task is to print the contents of RTB at the location with respect to location of RTB.
Following code helps for printing the contents of a RTB on whole paper but is not helpfull in my situation.
http://support.microsoft.com/default.aspx?scid=kb;en-us;811401[^]
Does anybody have some idea how can i implement this.
Thanks in advance for Any help.
colgateas900197
|
|
|
|
|
Have you tried something like this[^]?
|
|
|
|
|
Yes indeed - the MCL Form Print Control[^] (artcile and VB.Net code on this site) can do just that....
Drop the component on your target form and it will add a number of extended properties to each control on that form. Use these to set whereabouts on the printed page you want the RTF boxes to print and any border or background colours etc. and then call its Print() method.
|
|
|
|
|
thanks it helped.....
infact it solved.
colgateas900197
|
|
|
|
|
Oops - I found a bug...if you preview a form twice or preview then print it th eRTF box doesn't show.
To fix it, alter the "NewLogicalPage" sub in the RTFControlPrintSetting class to clear down the _CurrentChar variable thus:-
#Region "NewLogicalPage"
Public Overrides Sub NewLogicalPage()
If _RichTextBoxPrintMethod = RichTextBoxPrintMethods.PlainText Then
With Me.RichTextBoxControl
_CurrentLine = 0
_Lines = .Lines
_TotalLines = _Lines.Length
End With
Else
_CurrentChar = 0
_TotalChars = Me.RichTextBoxControl.TextLength
End If
End Sub
#End Region
|
|
|
|
|
Hi I am using VB2005 as fon-end and sqlserver 2005 Express edition
as Back end.I want to get Direct printout in crystal report from
VB2005 form.I use the following piece of code To Display
crystal Report..But for direct printout I don't know...Plz Help...
Dim rpstr As String
rpstr = "select * from viewRequisitions where bookingno ='" & Label15.Text + "' and " _
& "Requisitionno =" & Label9.Text + " and " _
& "Vehno ='" & Label13.Text + "' and " _
& "Day(RequisitionDate) = '" & Format(DTPReqDt.Value, "dd") + "' and " _
& "Month(RequisitionDate) = '" & Format(DTPReqDt.Value, "MM") + "' and " _
& "Year(RequisitionDate) = '" & Format(DTPReqDt.Value, "yyyy") + "' "
Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
Me.Crpt.DiscardSavedData = True
Me.Crpt.SQLQuery = rpstr
Me.Crpt.WindowState = Crystal.WindowStateConstants.crptMaximized
Me.Crpt.Destination = Crystal.DestinationConstants.crptToWindow
Me.Crpt.Action = 1
Keshaba
|
|
|
|
|
<br />
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)<br />
Const WM_SYSCOMMAND As Long = &H112<br />
Const SC_MOVE As Int32 = &HF010<br />
<br />
If m.Msg = WM_SYSCOMMAND Then<br />
'The four low order bits of wParam are used internally by Windows,<br />
'so we need to do a bitwise and with FFF0 to get the real value.<br />
If ((m.WParam.ToInt32 And &HFFF0) = SC_MOVE) Then Exit Sub<br />
End If<br />
<br />
MyBase.WndProc(m)<br />
End Sub<br />
can anyone tell me what this code does
It was written by an ex co-worker and I have no idee what it does
Here is what I was able to find out so far:
-whenever I debug I eventually end up in this methode wich then runs several times (everytime differant count) and when it finally exists my code (that I was debugging) runs a second time but with no action taken it just seems to glance over the code without output.
-this code seems to be running continuasly
-when removing the code there doesn't seem to be any visual differance but without knowing what the code does I dare not remove it permantly
any help would be appriciated
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
I tried this piece of code in an empty vb.net app, and it seems to supress the window movement.
|
|
|
|
|
true but I don't think that that is its main purpuse I believe that the movement supressing is a 'side-affect' beceause the code is run continously.
also there is nowhere that this would be needed (the movement restriction) so I doubt that my ex co-worker implemented it for this.
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Here's the link[^] to the documentation on the WM_SYSCOMMAND notification message. It clearly shows that SC_MOVE is used to move the window. I've verified that both constants he used (0x112 and 0xF010) are correct and that, yes, the code stops the window its in from being moved. It's the only thing this code does.
|
|
|
|
|
thank you very much
now I know why this code is implemented
appearently the component we use (datawindows) (I know it sucks, wish I knew this 7 months ago, but I'm trying to get it thrown out, unfortanatly for this project that's not possible) acts as a window and can be moved around on the parent form so he supresses this using this code.
don't really like it (because this programme will be run on a terminal server so any code that runs (olmost) coninuasly is bad) but don't have a better solution so I guess I'll just let it be (for the moment)
thank you again
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
I´m not shure about this, but I think the code does not run continuously, only when an the user tries to move the window, windows will put the "move window" message in the queue, and then this code is executed. And when intercepting the windows move, there is less instead of more traffic)
|
|
|
|
|
i want to display record in datareport with dynamic
dim con as adodb.connection
dim cmd as adodb.recordset
set con=new adodb.connection
set rs=new adodb.recordset
con.open"dsn=dsnname ( data base msaccess)
rs.open"select * from emp where empname='" & text.text & "',con,1,2
Datareport1.datasoure=rs
datareport1.show
i follow the above coding but the error display (invalid datasource and type mismatch)
iam not user the (data source property)
kindly send reply
|
|
|
|