|
I have a clarification to finish this task. When I send from my computer ie. dave@hiscompany.com
password: dave working fine.
Same program when I tested with other system, but same login,same password,same domain [dave@hiscompany.com & only computer name different] it's not working.......any ideas to solve this problem...?
Really what I planned, to use 1-user name & Password, for this purpose with all machines...
is it possible?
I mean, the user login will be different, from the program I want to supply another user network credentials...Is it possible?
Anybody can show me the code?
Thanks
|
|
|
|
|
is the other computer on the same network?
does the other computer have access to the same smtp server the first computer did?
is the other computer blocking port 25?
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
yah, same network under same domain. But it's a laptop, that machine is desktop.No other difference.
Even I tried the same user id,password. with same lan. May be laptop port no will be different?
How to identify that?
Thanks...
|
|
|
|
|
port no 25 is for SMTP only, check in your laptop is this port is blocked by any firwall or antivirus softwares.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hi all,
I'm new into the forum and I have a question for you. How can I use the Win API 'SetParent' under VB 2008 to open a secondary form into a picturebox on a primary form? I need this because I want simulate a MDI form. For VB6 I used the following code and It works fine:
'<<declaration>>
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
'<<function>>
Public Function SetParentInRect(FormChild As Variant, FormParent As Variant)
On Error GoTo ErrorHandler
Dim lChild As Long
Dim lParent As Long
On Error Resume Next
If IsObject(FormChild) Then
lChild = CallByName(FormChild, "hwnd", VbGet)
If lChild = 0 Then Err.Raise 1000, , "Cannot obtain handle from formchild"
Else
lChild = CLng(FormChild)
End If
If IsObject(FormParent) Then
lParent = CallByName(FormParent, "hwnd", VbGet)
If lParent = 0 Then Err.Raise 1000, , "Cannot obtain handle from formparent"
If TypeName(FormParent) = "MdiMain" Then
lParent = FindWindowEx(lParent, 0&, "MDIClient", vbNullString)
End If
If TypeName(FormParent) = "frmMain" Then
lParent = FormParent.picContainer.hWnd
End If
Else
lParent = CLng(FormParent)
End If
If Not IsWindow(lChild) Then Err.Raise 1000, , "Invalid form Handle : " & lChild
If Not IsWindow(lParent) Then Err.Raise 1000, , "Invalid form Handle : " & lParent
SetParent lChild, lParent
If False Then
ErrorHandler:
Err.Raise Err.Number, IIf(Len(Err.Source) > 0, Err.Source & "->", "") & "clsParent", Err.Description
End If
End Function
The sencondary form have the follwing property:
startupposition = manual
borderstyle = none
windowsstate = maximized
Is there anyone can help me (to translate this function in VB 2008)?
Thanks a lot,
Filippo
|
|
|
|
|
something like this?
PictureBox1.Controls.Add(New Form2 With {.TopLevel = False, .Visible = True, .Dock = DockStyle.Fill})
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Yes! It works exactly as I need.
Thank you wery much for you suggestion!
Filippo
|
|
|
|
|
Readonly with Editor is not working as readonly after setting the image and it is working as readonly but not setting the iMage to picture
<[ReadOnly](True)> <Editor(GetType(ImageOpenFileDialog), GetType(System.Drawing.Design.UITypeEditor))> _
Public Property BackgroundPicture() As String
Public Class ImageOpenFileDialog
Inherits UITypeEditor
Dim openFileDialog As OpenFileDialog
Public Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal provider As System.IServiceProvider, ByVal value As Object) As Object
openFileDialog = New OpenFileDialog()
openFileDialog.FileName = ""
openFileDialog.Filter = "JPEG Images|*.jpg|GIF Images|*.gif|Bitmaps|*.bmp"
openFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyPictures
If openFileDialog.ShowDialog() = DialogResult.OK Then
Return openFileDialog.FileName
End If
Return MyBase.EditValue(context, provider, value)
End Function
Public Overrides Function GetEditStyle(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.Drawing.Design.UITypeEditorEditStyle
Return UITypeEditorEditStyle.Modal
End Function
End Class
I am creating a readonly Property and if i click i open the Images to select the image . as it is a readonly property i am not able to set teh image to picture box .
----------
Working on Visual Studio 2005 PropertyGrid .
I want to lock all the keys not to enter in the propertygrid at the Picture Property like in Visual Basic 6.0 after selecting the image . Only Delete has to work
PictureBox -- Picture Property -- (Bitmap) after setting the image
so that the user shouldnot change the value
Presently i got the (None) in this way . Now i want to set the ReadOnly and only Delete key has to work and i want to set the Picture to PictureBox.
|
|
|
|
|
Hi,
While trying to create a group of tables in msaccess using VB.NET ADOX, i am facing the error "System.Runtime.InteropServices.COMException...at ADOX.columns.Append(Object item, DatatypeEnum Type, Int32 DefinedSize)".
The coding is given below..
Public Function CreateAccessDatabaseandtables( _
ByVal DatabaseFullPath As String) As Boolean
Dim bAns As Boolean
Dim con As New ADODB.Connection
Dim cat As New ADOX.Catalog()
Dim ADOXtable As New ADOX.Table
Dim ADOXindex As New ADOX.Index
Try
Dim sCreateString As String
sCreateString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
DatabaseFullPath
cat.Create(sCreateString)
bAns = True
'cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabaseFullPath
con.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabaseFullPath)
'name table, append fields to table
ADOXtable.Name = "ACN_CHARX"
ADOXtable.Columns.Append("LOGICAL_DB_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("DIM_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("CHARX_NAME", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_SEQ", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_TYPE", ADOX.DataTypeEnum.adVarWChar, 1)
ADOXtable.Columns.Append("BITMAP", ADOX.DataTypeEnum.adInteger)
'append tables to database
cat.Tables.Append(ADOXtable)
ADOXtable.Name = "ACN_CHARX_INSTANCE"
ADOXtable.Columns.Append("LOGICAL_DB_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("DIM_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("CHARX_NAME", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_TABLE", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_VALUE_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("VALUES_UNIQUE", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_ORDER_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_ORDER", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_NUMERIC_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("BITMAP_COL", ADOX.DataTypeEnum.adVarWChar, 128)
'append tables to database
cat.Tables.Append(ADOXtable)
Catch Excep As System.Runtime.InteropServices.COMException
bAns = False
MessageBox.Show(Excep.ToString)
Finally
cat = Nothing
End Try
Return bAns
End Function
Please help me to rectify this error...
Thanks,
Sivakumar.M.
modified on Wednesday, June 17, 2009 6:45 AM
|
|
|
|
|
Does the exception tell which line of code exactly is throwing the error?
My advice is free, and you may get what you paid for.
|
|
|
|
|
No...Actually the first table "ACN_CHARX" is created successfully... when it crosses the line "ADOXtable.Name = "ACN_CHARX_INSTANCE" ", the first created table name is automatically renamed.. ie)from "ACN_CHARX" into "ACN_CHARX_INSTANCE". Then the control tried to create the first column of the second table "Logical_db_name"...Then it shows this error....
|
|
|
|
|
I expect you need to add
ADOXtable = New ADOX.Table
between each table. Probably the same for the index.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thanks for your nice solution....Now it is working fine....In addition with this, could you please mention how to add constraints with table columns through coding?
|
|
|
|
|
No problem, easy mistake to make, done it myself but usually realise when running in debug and stepping through the code
sivakumar.mariappan wrote: how to add constraints with table columns through coding?
No idea, I don't use access, but I bet google can help
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi,
I am new in Dotnet. I read the excel upto used ranges and print the data to messagebox. But I got Each value one by one after click the ok button.
But i need display the total data at once.
My Code is:
dim exapp as excel.application
dim exwork as excel.workbook
dim exsheet as excel.worksheet
exapp = New Excel.ApplicationClass
exwork = exapp.Workbooks.Open(TextBox1.Text)
exsheet = exwork.Worksheets("sheet1")
range = exsheet.UsedRange
For rcount = 1 To range.Rows.Count
For ccount = 1 To range.Columns.Count
obj = CType(range.Cells(rcount, ccount), Excel.Range)
MsgBox(obj.value)
Next
Next
exwork.Close()
exapp.Quit()
MsgBox("complete")
TextBox1.Clear()
Example: (In Excel)
No Name Age
1 Gopi 26
2 raja 24
3 mani 29
Output:
No,Name,Age
1,Gopi,26
2,raja,24
3,mani,29
But I got Each value one by one. I need full ouput as once. Please help me.
By
Gopi A
|
|
|
|
|
Well, you put a messagebox inside of a loop inside of another loop.
In other words, you are looping through all the cells in the sheet, and showing a messagebox for the value of each cell.
Try to concatenate the values in the cells into a string (for example) somehow, and then (for testing purposes) place MsgBox(MyConcatenatedString) outside the outer loop.
My advice is free, and you may get what you paid for.
|
|
|
|
|
try
dim st as string 'or to stringbuilder
dim exapp as excel.application
dim exwork as excel.workbook
dim exsheet as excel.worksheet
exapp = New Excel.ApplicationClass
exwork = exapp.Workbooks.Open(TextBox1.Text)
exsheet = exwork.Worksheets("sheet1")
range = exsheet.UsedRange
For rcount = 1 To range.Rows.Count
For ccount = 1 To range.Columns.Count
obj = CType(range.Cells(rcount, ccount), Excel.Range)
st = st + convert.tostring(obj)
Next
Next
MsgBox(st)
exwork.Close()
exapp.Quit()
MsgBox("complete")
TextBox1.Clear()
|
|
|
|
|
Anyhow I succeeded the SMTP-Emails. But as anext step, when they use my program, I want to send from their emails a/c. Rightnow I know only my network user Name & Paswword & My-email a/c name etc..
So how to detect their [network] system user name [I can find], Password, Email a/c ....?
Any better ideas for me? All my network Clients are using Windows XP
Thanks Again....
modified on Wednesday, June 17, 2009 3:47 AM
|
|
|
|
|
For obvious reasons it is not possible to just retrieve passwords to anything, through .net, think about it.
So unless you are intending to build a spam bot, you will simply have to offer the user the possibility to enter email address and password somewhere, and build a secure storage for that password, so hackers won't be able to abuse your program to collect passwords.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hello,
How can you change the size of the MDI container in a MDI parent form?
|
|
|
|
|
The control is MdiClient. You just need to enumerate the Controls collection of the form, looking for a control of Type MdiClient. Then you need to turn off the Dock proeprty and set the position and size properties to whatever you need.
|
|
|
|
|
Is this the way you mean,but it's not working.When maximize the parent form,the child form maximizes to the entire form.What is the problem?
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is MdiClient Then
ctrl.Dock = DockStyle.None
ctrl.Location = New System.Drawing.Point(1, 107)
ctrl.Size = New System.Drawing.Size(769, 434)
End If
Next
|
|
|
|
|
That code works fine and as expected, though I'd probably add an Exit For before the End If .
If you're saying that the title bar for the child form takes up the entire width of the patent form, this is the expected behavior and you can't turn it off.
If you're saying that if you maximize the parent form and this causes the child form to maximize also, then something in your code is causing this. The code you posted will not do cause that problem to happen.
|
|
|
|
|
Hi,
I want to initiate a uninstall process of an application (already install) through another vb.net application.
Is it possible?
Mithun Shitole
"Free Your Mind"
http://www.technoyaari.com
|
|
|
|
|
Yes. It can be done using the Process class.
जय हिंद
|
|
|
|
|