|
Yea thaks for your guides, i am already analyzing several samples and integrating them into one single project, hopefully i can publish one control in future =) thanks!
|
|
|
|
|
This has been overdone, yet not so... i am looking for a simple way to send emails using vb. I have tried the code to no avail. I have SP6 so i redid the .dll and reregistered it. It would still not connect, stating that ther server was not respoding to the inqury. I've tried countless ways, the most i got was with yahoo mail, that got up to 6% and errored. The general consensis is that these things are tricky if possible to get to work. anyone who succeded would be greatly appreciated. I will use any webmail. hotmail, gmail, yahoo.com or yahoo.ca if anyone knows the proper way to get these to respond.. the only other option is that my outlook to be configured to hotmail, and then set vb to use outlook with MAPI...
"Love, Life and Option Explicit"
|
|
|
|
|
Outlook Express is just a wrapper for the MAPI Api, which your VB6 code is also using. Any settings done in Outlook Express will also effect your code.
But, you have to specify the SMTP and POP3 servers that Yahoo, or any other mail server, is using. You might even have to supply some kind of login to send anything using those servers. I have no idea myself, since I never use them...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The code i linked to uses STMP and POP3 servers, and lets you specify login-in informatio, yet it will not show thre respones.. it also inclides a mx query to find ther servers, yet it will not return any response from them.
"Love, Life and Option Explicit"
|
|
|
|
|
ThePmanLives wrote: The code i linked to uses ...
What code? I didn't see a link to any code...
ThePmanLives wrote: yet it will not show thre respones..
What is "it"?
ThePmanLives wrote: it also inclides a mx query to find ther servers
MX query??? Not in an SMTP session. Is this a DNS request you're doing?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hmmm.. it appears the link did not show... http://www.freevbcode.com/ShowCode.Asp?ID=109
it is a .dll that should let you set it up that way. the mxquery, i assumed would locate mail servers, as in my research i found people trying to ocnnect to the mx1.hotmail.com, and having it succeed. "IT" is the program from the a-for-mentioned link. it keeps telling me the servier will not respod to queries.
"Love, Life and Option Explicit"
|
|
|
|
|
OK. An MX ookup is a DNS query that returns registered mail servers, so long as the servers are registered in the DNS that your querying. You can test this by launching a command prompt and typing:
C:\>NSLOOKUP
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Default Server: UnKnown
Address: 192.168.0.1
> server mx1.hotmail.com
Default Server: mx1.hotmail.com
Addresses: 65.54.244.8, 64.4.50.50, 65.54.245.8, 65.54.244.136
> set type=MX
> hotmail.com
Server: mx1.hotmail.com
Addresses: 65.54.244.8, 64.4.50.50, 65.54.245.8, 65.54.244.136
Non-authoritative answer:
hotmail.com MX preference = 5, mail exchanger = mx4.hotmail.com
hotmail.com MX preference = 5, mail exchanger = mx1.hotmail.com
hotmail.com MX preference = 5, mail exchanger = mx2.hotmail.com
hotmail.com MX preference = 5, mail exchanger = mx3.hotmail.com
mx1.hotmail.com internet address = 64.4.50.50
mx1.hotmail.com internet address = 65.54.245.8
mx1.hotmail.com internet address = 65.54.244.136
mx1.hotmail.com internet address = 65.54.244.8
mx2.hotmail.com internet address = 65.54.245.40
mx2.hotmail.com internet address = 65.54.244.168
mx2.hotmail.com internet address = 65.54.244.40
mx2.hotmail.com internet address = 65.54.190.50
mx3.hotmail.com internet address = 65.54.244.200
mx3.hotmail.com internet address = 64.4.50.179
mx3.hotmail.com internet address = 65.54.244.72
mx3.hotmail.com internet address = 65.54.245.72
mx4.hotmail.com internet address = 65.54.190.179
mx4.hotmail.com internet address = 65.54.244.104
mx4.hotmail.com internet address = 65.54.244.232
mx4.hotmail.com internet address = 65.54.245.104
>
This is a normal DNS query that the component is making. It returns the entire list of regeistered mail server at HotMail. The component would then try to use any of these mail servers to send your mail.
The problem is that this is a custom written component that I/We've never used or even seen. I can't tell you what it needs to work and I can't tell you why it's saying that there are no servers. I just don't know how the component works or why it fails. The best source of information is the site or person who wrote it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Please send me the simplest procedure to connect SQL with VB.NET.
Umair Qayyum
|
|
|
|
|
This is the simplest procedure to connection SQL with VB.NET:
Dim myConnection As SqlConnection = New SqlConnection(myConnectionString)
myConnection.Open()
This assumes that you have the connection string in a variable called myConnectionString.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
-- modified at 8:04 Sunday 12th February, 2006
|
|
|
|
|
Hello
i am trying to find a way that i can change the Printer.CurrentY from 1300 to 1550 for the next record and increse it by 250 for each record in the database. i have tried for next and do loop if anyone has any idea how to do this i would be most greatful.
Printer.CurrentX = 7500
Printer.CurrentY = 1300
Printer.Print RowBuf(5, i)
|
|
|
|
|
You haven't posted any For/Next loop code, so it's impossible to tell you what went wrong. It's been over 5 years since I touched VB6, so let's see:
Dim i As Long
For i = 0 to 10
' More printer code...
Printer.Y = Printer.Y + (i * 250)
' Whatever else you're printing...
Next i
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks dave here is the code that i am trying to use. i added you bit but it prints like this
aaaa
bbbb
cccc
not like aaaa bbbb cccc
i hope this helps
Do Until rs.EOF
RowBuf = rs.GetRows(5000)
RowsReturned = UBound(RowBuf, 2) + 1
For i = 0 To RowsReturned - 1
For s = 0 To 10
Printer.CurrentX = 500
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(2, i)
Printer.CurrentX = 2000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(3, i)
Printer.CurrentX = 2750
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(4, i)
Printer.CurrentX = 6000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(6, i)
Printer.CurrentX = 7500
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(5, i)
If adoMeds.Recordset.Fields("finish") <> "None" Then
Printer.CurrentX = 9000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(7, i)
Else
Printer.CurrentX = 9000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print " "
End If
Next s
Next i
Loop
|
|
|
|
|
sorry i did try Printer.CurrentY = Printer.CurrentY + (s * 250)
with the same result as with the +
bolson50 wrote: thanks dave here is the code that i am trying to use. i added you bit but it prints like this
aaaa
bbbb
cccc
not like aaaa bbbb cccc
i hope this helps
Do Until rs.EOF
RowBuf = rs.GetRows(5000)
RowsReturned = UBound(RowBuf, 2) + 1
For i = 0 To RowsReturned - 1
For s = 0 To 10
Printer.CurrentX = 500
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(2, i)
Printer.CurrentX = 2000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(3, i)
Printer.CurrentX = 2750
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(4, i)
Printer.CurrentX = 6000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(6, i)
Printer.CurrentX = 7500
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(5, i)
If adoMeds.Recordset.Fields("finish") <> "None" Then
Printer.CurrentX = 9000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print RowBuf(7, i)
Else
Printer.CurrentX = 9000
Printer.CurrentY = Printer.CurrentY + (s + 250)
Printer.Print " "
End If
Next s
Next i
Loop
|
|
|
|
|
thanks dave i did play with it some more and got it to work here is the code i used.
Dim s As Long
Dim sp As Long
For i = 0 To RowsReturned - 1
sp = Printer.CurrentY = 1300
s = Printer.CurrentY + (sp + 0)
Printer.CurrentX = 500
Printer.CurrentY = s
Printer.Print RowBuf(2, i)
Printer.CurrentX = 2000
Printer.CurrentY = s
Printer.Print RowBuf(3, i)
Printer.CurrentX = 2750
Printer.CurrentY = s
Printer.Print RowBuf(4, i)
Printer.CurrentX = 6000
Printer.CurrentY = s
Printer.Print RowBuf(6, i)
Printer.CurrentX = 7500
Printer.CurrentY = s
Printer.Print RowBuf(5, i)
If adoMeds.Recordset.Fields("finish") <> "None" Then
Printer.CurrentX = 9000
Printer.CurrentY = s
Printer.Print RowBuf(7, i)
Else
Printer.CurrentX = 9000
Printer.CurrentY = s
Printer.Print " "
End If
Next i
|
|
|
|
|
BC30108: 'FormsAuthenticationTicket' is a type and cannot be used as an expression.
objTicket = FormsAuthenticationTicket(2, textUsername.Text, DateTime.Now.AddMinutes(30), False, dtrRoles)
|
|
|
|
|
Have you missed out the New keyword?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hi,
I have an web application running on a applicationserver. Now I want to shutdown local software on the client from the browser.
I use asp.net but I realized I needed av VBscript to execute on the local client to be able to get a handle for the local applicaition that I want to shutdown. But how do I use the WINAPI methods sendMessage and findWindow in VBscript. I know I have to import user32.dll.
Im really bad at scripting...)
THANKS!
Ibana
|
|
|
|
|
VBScript, or any script running in a browser for that matter, has absolutely no access to the Win32 Api. It's impossible to do what you want from inside a browser session without the user downloading, installing, and allowing script to execute, a custom COM object that does the same thing.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for your replay,
Do you have any suggestion how to access the winapi on the local machine from my asp.net/C# application running on a server. I need to use the winapi to shutdown a local installed software.
Should a make a small app that runs on the local machine that calls the winapi? Are there any better solutions?
/ibana
|
|
|
|
|
There is NOTHING in your ASP.NET code that can get to the client machine. It's IMSPOSSIBLE. Your app will have absolutely no permissions onthe local machine.
Also, script running inside a browser session will not have any access to other processes running outside the browser session and has no access to any client hardware or system resources.
The user MUST install a component to do this, and it will ONLY work if security inside the browser is stripped down to nothing! Your web app cannot stop a process outside the browser, period, unless the user turns the security for the zone your code came from down to nothing! This is something that no sane network admin on earth would do!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I know this is a bit old discussion, but thought of sharing this:
Info/Theory:
~~~~~~~~~~~
User32.dll is the source of many of the most common Windows API's, that allow you to
interact with the operating system at a lower level.
Please check: https://social.msdn.microsoft.com/Forums/windows/en-US/b04153ff-e4fb-4500-a8e4-3a685208af57/when-to-use-user32dll-and-how?forum=winforms
Following is the code to access Win32 API using VBSCript.
---------------------------------------------------------
' --------------- Start of Code ------------------------------------------------------------
Dim excel
Set excel = CreateObject("Excel.Application")
Dim strMacro
strMacro = "CALL('user32', 'MessageBoxA', 'JJCCJ', 0, 'Hello, Win32 API(VBScript) World - My call via User32 dll!', 'Hello, World!', 0)"
strMacro = Replace( strMacro, "'", """" )
excel.ExecuteExcel4Macro( strMacro )
'---------------- End of Code --------------------------------------------------------------
Copy the above to a notepad & save it as : myMessage.vbs and double click it.
Expected Result: Please see the script in action : Windows API VBScript Calling User32 DLL directly - YouTube[^]
|
|
|
|
|
That's cute and all, but it also requires Office be installed on the machine in order to work and that's not going to be the case on every machine.
Frankly, using Excel as an intermediary just to run a single line of code is a very heavy cost and a bit ridiculous.
|
|
|
|
|
This only happens if you have any of the following type of laptops:
a) Mac / MacBook with IoS
b) Laptop used exclusively for non-MS office testing
c) New Laptop with no MS Office Installed
d) Loaner laptop with no MS Office
e) Sometimes if you have had a crash of MS Office on your laptop - then also the Excel Application
will not work - for this.
f) if your enterprise IT has disabled using MS Office COM Objects and/or restricted authorization
to use MS Office COM objects/APIs.
ELSE I do not know of any other reason - any laptop not having MS Office installed.
But the solution does work - and you do not need to use any other tools.
Good luck.
|
|
|
|
|
First, using a heavy weight application, like Excel, to call a couple of Win32 API's is ridiculous.
Also, going back to the original context of the question, the script, running in a browser, can NOT create an instance of Excel. COM-interop is off-limits because of security concerns. It's also the reason ActiveX is no longer supported by browsers.
|
|
|
|
|
Does anyone know a way for me to use a Windows icon that is stored on the Shell32.DLL file? I'm sure there is a Windows API call for this but I can't find it.
For example: If I selected a Drive from the DriveList control I want the icon for the selected drive to show up on the Treeview control as the root node.
Thank you
Quecumber256
|
|
|
|
|