|
refering you to your post[^]
|
|
|
|
|
Sir/Madam,
Can , I send the mail programically in vb.net (Window Application).
If possible please send a sample code link.
Thanks and Regards
Pankaj
|
|
|
|
|
you can try this:
Try
Dim oMessage As MailMessage = New MailMessage
oMessage.Body = "MESSAGE COMES HERE"
oMessage.To.Add(TO_User_Email)
Dim oFrom As MailAddress = New MailAddress(FROM_User_Email)
oMessage.From = oFrom
oMessage.Subject = "SUBJECT COMES HERE"
'oMessage.IsBodyHtml = True
'oMessage.Priority = MailPriority.Normal
Dim oSMTP As SmtpClient = New SmtpClient("Localhost")
oSMTP.Send(oMessage)
Catch ex As Exception
End Try
|
|
|
|
|
forgot to add :
<br />
Imports System.Net.Mail<br />
|
|
|
|
|
Sir/Madam,
It is for Window application or Web application?
Thanks and regards
Pankaj
|
|
|
|
|
Both.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi all friends
I want to work with Treeview Control in one program, but I have some problems:
1- Are keys of all nodes unique like VB6? I think only children of one node should have unique keys.
2- How can I set one treenode variable to one node with special key?
Many thanks
Mansour
|
|
|
|
|
how to create software component to check whether input on combo boxes and textboxes in a program are valid SQL statements..So as to block SQL injection implemented through reg ex
riane
|
|
|
|
|
Your question has nothing to do with web services. To stop an injection attack, just make sure that there's no quotes, if you're accepting text for a string. If you strip the quotes, whatever is typed, gets inserted as a string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
how to create software component to check whether input on combo boxes and textboxes in a program are valid SQL statements..So as to block SQL injection implemented through resex<
riane
|
|
|
|
|
Please don't ask twice
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am using this code to try and save a word document, although it does work,
when it is pasted in to the word doc it loses any formating.
Is there an article on how to paste from the clipboard and keep the format?
My Code
Case ".DOC"<br />
' Copy the contents of the textbox to the clipboard<br />
Clipboard.SetDataObject(rtbText.Text)<br />
objWord = CreateObject("Word.Application")<br />
objTempDoc = objWord.Documents.Add<br />
objWord.visible = True<br />
<br />
With objTempDoc<br />
.Content.Paste()<br />
.Activate()<br />
.Save()<br />
End With<br />
objWord.Quit()
|
|
|
|
|
Try using rtbText.Rtf which will get the text with the RTF formatting. You may also want to set the text with:
Clipboard.SetText(rtbText.Rtf, TextDataFormat.Rtf); which will tell the clipboard it's formatted text.
I have no idea what I just said. But my intentions were sincere.
Poore Design
|
|
|
|
|
Thanks for that Poore, it worked a treat, but,(there's always a but!)
although this saves the word doc with all it's formating, when I open it in my program the formating does not show, if I open it in word the formating does show so I know it's there, I figure it's the way I am opening the document in my program that is wrong, so here is the code that I am using.
I've tried changeing rtbText.text to rtbText.rtf but that didn't work either.
<br />
<p><font SIZE="2" COLOR="#0000ff">Case</font><font SIZE="2"><br />
<font SIZE="2" COLOR="#a31515">"doc"<br />
</font><font SIZE="2"><br />
<p>objWord = CreateObject(</font><font SIZE="2" COLOR="#a31515">"Word.Application"</font><font SIZE="2">)<br />
<p>objDoc = objWord.Documents.Open(OFD1.FileName)<br />
<p>objDoc.Select()<br />
<p>rtbText.Text = objWord.Selection.Text<br />
<p>objDoc.Close()<br />
<p>objWord.Quit()</p><br />
</font><br />
<br />
|
|
|
|
|
I know it's not the ideal method but have you tried doing what you did in the first instance (i.e. using the clipboard) but in reverse because that way I think that Word will copy the formatted (as well as plain) text onto the clipboard.
Just make sure that when you use Clipboard.GetText that you specify you want the RichText version.
I have no idea what I just said. But my intentions were sincere.
Poore Design
|
|
|
|
|
Hello,
This is my first delve into XML namespaces and I'm having a VERY difficult time parsing the XML because of the Namespace. If I remove the namespace then I get no problems. It would really be appreciated if anybody out there can cure my headache!
Here is my code:
Dim xmlDoc As New System.Xml.XmlDocument()
Dim resolver as XmlUrlResolver = new XmlUrlResolver()
Dim datasource as XmlDataSource = new XmlDataSource()
resolver.Credentials = New NetworkCredential("username", "password")
xmlDoc.XmlResolver = resolver
xmlDoc.Load("http://somedomain.com/webservicename")
Dim xsn as XmlNamespaceManager = new XmlNamespaceManager(xmlDoc.NameTable)
xsn.AddNamespace("t", "urn:ahw:itemlist")
xmlData.Document = xmlDoc
xmlData.TransformSource = "test.xsl"
Here is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<itemlist xmlns="urn:ahw:itemlist">
<item name="Photos" friendly-name="Photos" />
<item name="Videos" friendly-name="Videos" />
<item name="OtherMedia" friendly-name="Other Media" />
</item-type-list>
Here is the xsl:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="itemlist">
<TABLE BORDER="2">
<TR>
<TD>Display Name</TD>
<TD>Name</TD>
</TR>
<xsl:for-each select="item">
<TR>
<TD><xsl:value-of select="@friendly-name"/></TD>
<TD><xsl:value-of select="@name"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
Here is my asp.net page (the main part where I want the XML to display):
<form runat="server">
<asp:Xml ID="xmlData" runat="server"/>
</form>
Thanks so much for your time!
Chris
|
|
|
|
|
Sorry, I should be able to figure this out. Seems like .net should have made this easy, though.
How do I run an .exe file inside a panel or tab within my form?
thanks
|
|
|
|
|
cstrader232 wrote: Seems like .net should have made this easy, though.
Why? Why does every noobie think that the .NET Framework should be this be-all, end-all, embodiment that makes everything so much easier? What ever happened to writing code to do it yourself?
But, I digress...
cstrader232 wrote: How do I run an .exe file inside a panel or tab within my form?
It's not a good idea, because no application actually supports doing this, but it is possible to change the parent of a window to another window. You can get some strange things happening during painting, so don't say you weren't warned.
Private Declare Auto Function SetParent Lib "user32" ( _
ByVal hwndChild As IntPtr, _
ByVal hwndParent As IntPtr) _
As IntPtr
.
.
.
' Launch a new Notepad process, wait for it's window to be created
' then reset that window so it's parent is another window in our
' application. In this case, a Panel control.
Dim p As Process = Process.Start("Notepad.exe")
p.WaitForinputIdle()
SetParent(p.MainWindowHandle, Panel1.Handle)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: What ever happened to writing code to do it yourself?
Amen.
|
|
|
|
|
Well yeah, that works. But in this case I found that someone had already done it for me!!! Here's the snippet I found to work from: Seems to be working OK for me.
Option Strict Off
Option Explicit On
Module MTestWindow
Private Const GW_HWNDNEXT As Short = 2
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal HWnd As Integer, ByRef lpdwProcessId As Integer) As Integer
Private Declare Function GetParent Lib "user32" (ByVal HWnd As Integer) As Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"(ByVal lpClassName As Integer, ByVal lpWindowName As Integer) As Integer
Private Declare Function GetWindow Lib "user32" (ByVal HWnd As Integer, ByVal wCmd As Integer) As Integer
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA"(ByVal HWnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer
Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
Public old_parent As Integer
Public child_hwnd As Integer
'Show Window
'Brings back inside MDI but minimized if notepad was minimized
Private Declare Function SetForegroundWindow Lib "user32" (ByVal HWnd As Integer) As Integer
'Minimize Window
Private Declare Function CloseWindow Lib "user32" (ByVal HWnd As Integer) As Integer
'Maximize Window
Private Const SW_MAXIMIZE As Short = 3
'Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal HWnd As Integer, ByVal nCmdShow As Integer) As Integer
'Close (Terminate) Window
Const WM_CLOSE As Short = &H10s
'UPGRADE_ISSUE: Declaring a parameter 'As Any' is not supported. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal HWnd, ByVal wMsg, ByVal wParam, ByRef lParam) As Integer
Private Function InstanceToWnd(ByVal target_pid As Integer) As Integer
'Return the window handle for an instance handle.
'This came from VB-Helper, but See Q242308 appears to be original
Dim test_hwnd As Integer
Dim test_pid As Integer
Dim test_thread_id As Integer
' Get the first window handle.
test_hwnd = FindWindow(0, 0)
' Loop until we find the target or we run out
' of windows.
Do While test_hwnd <> 0
' See if this window has a parent. If not,
' it is a top-level window.
If GetParent(test_hwnd) = 0 Then
' This is a top-level window. See if
' it has the target instance handle.
test_thread_id = GetWindowThreadProcessId(test_hwnd, test_pid)
If test_pid = target_pid Then
' This is the target.
InstanceToWnd = test_hwnd
Exit Do
End If
End If
' Examine the next window.
test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
Loop
End Function
Public Function ShowMDIMinimized(ByRef lngHWnd As Integer) As Object
'This brings the Window as minimized within the MDI Form
'if it was originally hidden
Dim dl As Integer
dl = SetForegroundWindow(lngHWnd)
End Function
Public Function MinimizeWindow(ByRef lngHWnd As Integer) As Object
'Hide the Window
Dim dl As Integer
dl = CloseWindow(lngHWnd) '<<minimize
="" end="" function
="" public="" function="" maximizewindow(byref="" lnghwnd="" as="" integer)="" object
="" 'maximize="" the="" window
="" if="" <=""> 0 Then
ShowWindow(lngHWnd, SW_MAXIMIZE)
End If
End Function
Public Function FreeWindowFromMDI(ByRef hChild As Integer, ByRef hOldParent As Integer) As Object
SetParent(hChild, hOldParent)
End Function
Public Function TerminateWindow(ByRef lngHWnd As Object) As Object
'Post a message to the window to close itself
'UPGRADE_WARNING: Couldn't resolve default property of object lngHWnd. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
PostMessage(lngHWnd, WM_CLOSE, 0, 0)
End Function
Public Function RunWindow(ByRef strApp As String) As Object
Dim pid As Integer
' Dim buf As String
' Dim buf_len As Long
' Dim styles As Long
' Start the program.
pid = Shell(strApp, AppWinStyle.NormalFocus)
If pid = 0 Then
MsgBox("Error starting program")
Exit Function
End If
' Get the window handle.
child_hwnd = InstanceToWnd(pid)
MDIForm1.Text = Str(child_hwnd)
' Reparent the program so it lies inside
' the MDI form.
old_parent = SetParent(child_hwnd, MDIForm1.Handle.ToInt32)
End Function
End Module
|
|
|
|
|
hello friends
i m doing my pg in computer science can anyone suggest me a good topic for project.
|
|
|
|
|
hi,
r u talking about any dummy(sample)projects??
u can develop the sample applications like Student management system, Banking system, AddressBook, Personal Assistant,
Shopping cart,Webbased Address Book etc., if u r looking for sample applications,long back i saw one site where u can find the sample applications with source code. just check the urls for the sample applictions. but it's better to take the specification from that site and try to develop ur self by implementing ur own ideas.
u can find sample applications in microsoft site also.
check these links:
1. http://msdn2.microsoft.com/en-us/library/5ekc8at3(VS.80).aspx
2. http://support.businessobjects.com/communityCS/FilesAndUpdates/ce_vbnet_samples.exe.asp
3. a href=http://aspalliance.com/crystal/
4. http://www.binaryintellect.net/products/displayproductlist.aspx?categoryid=1
5. http://support.dtsearch.com/webhelp/dtengine/sample_applications.htm
thanks,
Rahithi Sharma
-- modified at 1:01 Saturday 20th January, 2007
-- modified at 1:08 Saturday 20th January, 2007
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Can anyone suggest the method to include an applet(run it) in a VB 6 form
mmmm
|
|
|
|
|
u had to ask that thrice?
ik pair past mein,te dooja pair future mein.tabhi to aaj pe moot rahe hain.
|
|
|
|
|
Can anyone suggest the method to include an applet(run it) in a VB 6 form
|
|
|
|