|
If you're new to VBScript, you'll find this nearly impossible to do.
It can be done but is FAR more complicated than you might think. Since you can have multiple browser windows open at the same time, there is no way for the script to know which browser to get a reference to. You'll have to enumerate the open browser windows, I think it's the Shell.Application object you need to do this, and find the window with the proper window title. There are other methods depending on what your needs are though.
Next, your script has to get the Document object that the browser is displaying. When you've got that, you can get to the HTML Form object in it and in that, the two fields you need to fill in. Lastly, tell the form to submit itself.
There's no example code in VBScript that I can find and I don't have any either. This process is described from my knowledge of how Windows, VBScript, Internet Explorer and various components works, not from actual experience doing it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I can Set comma to any number with Format (121212132.245,"#,##0.0033##") command line
how can i unset comma from number?
Format("123,2554,336.54655", "#######.00##")
this doent work
|
|
|
|
|
It doesn't work because you provided a string (as input) rather than an integer!
|
|
|
|
|
I am aware of that but u see , the number has commas. How could i write it as number ?
|
|
|
|
|
There may be easier way of doing it but one is:
private function StripNumber(s as string) as double
dim t as string
for i as integer=0 to s.length-1
if s.substring(i,1)<>"," then t = string.concat(t,s.substring(i,1))
next i
return val(t)
end function
|
|
|
|
|
MsgBox(Format(CDbl("123,2554,336.54655"), "#######.00##"))
|
|
|
|
|
Imagine two table
One Table (ForeignCurrency)
FC_ID FC_TYPE
1 USD
2 EUR
3 YTL
Other table (Rates)
FCV_ID FCV_RateIN FCV_RateOUT FCV_DATE
1 1 1 10/13/2005
2 1.345 1.346 10/13/2005
3 1.651 1.654 10/13/2005
I need to join two table in a one query. I do this so
Select FC.FC_TYPE,ISNULL(FCV_RateIN,1) FCV_RateIN,ISNULL(FCV_RateOut,1) FCV_RateOut from ForeignCurrency FC LEFT OUTER JOIN Rates R ON FC.FC_ID=R.FCV_ID WHERE FCV_Date='10/13/2005'
This give me result as i want. But when i need 10/14/2005 rates it give me empty result set , but i expect
FCV_TYPE FCV_RateIn FCV_RateOUT
YTL 1 1
USD 1 1
EUR 1 1
How can i re-write code ?
|
|
|
|
|
It looks like a misunderstanding of how the join works.
The SQL Engine performs a select on the two tables using the join. The 'left outer' part ensures that if there are entries in the ForeignCurrency table that do not have corresponding entries in the Rates table, then they will still be shown.
e.g
Add a new entry to the ForeignCurrency table
4 IEP
SELECT
FC.FC_TYPE
,ISNULL(FCV_RateIN,1) FCV_RateIN
,ISNULL(FCV_RateOut,1) FCV_RateOut
FROM
ForeignCurrency FC LEFT OUTER JOIN Rates R ON FC.FC_ID=R.FCV_ID
will give
FC_TYPE FCV_RateIN FCV_RateOut
USD 1 1
EUR 1.345 1.345
YTL 1.651 1.654
IEP 1 1
AFTER the join is performed the WHERE criteria are applied. Thus we check through the resultset for the FCV_Date='10/13/2005' (This is all conceptual - in practice the engine may optimize but it ACTS as if the steps happen in this order)
For 10/13/2005 all the rows in your test data match, so we are good
For 10/14/2005, no rows match so you get an empty set.
hth
Alan.
|
|
|
|
|
How can i re-write this code in Vb.net?
Pointers
void CReadOnlyComboBox::OnEnable(BOOL bEnable) <br />
{<br />
CComboBox::OnEnable(bEnable);<br />
<br />
CEdit* pEdit = (CEdit*)GetWindow(GW_CHILD);<br />
pEdit->EnableWindow(TRUE);<br />
pEdit->SetReadOnly(!bEnable);<br />
}
|
|
|
|
|
Greeky wrote: {
CComboBox::OnEnable(bEnable);
CEdit* pEdit = (CEdit*)GetWindow(GW_CHILD);
pEdit->EnableWindow(TRUE);
pEdit->SetReadOnly(!bEnable);
}
CComboBox::OnEnable(bEnable);
is equal to
MyBase.OnEnable(bEnable)
Now for the pointer that's more tricky. First I don't know the CEdit and the GetWindow function/method so you have to sort it out how to apply it.
If you only get a pointer as a result then:
CEdit* pEdit = (CEdit*)GetWindow(GW_CHILD);
Dim pEdit as IntPtr = GetWindow(GW_CHILD)
But if you want to access objects you need to make use of GCHandle, and that's where I don't have a full knowledge. I guess your code should be:
Dim pGCH as GCHandle
pGCH=GCHanlde.Alloc(pEdit)
Dim mEdit as cEdit = pGCH.Target
and then
pEdit->EnableWindow(TRUE);
pEdit->SetReadOnly(!bEnable);
mEdit.EnableWindow(True)
mEdit.SetReadOnly(Not bEnable)
finish by freeing garbage collector:
pGCH.Free
As I said I'm not 100% sure about the GCHanlde so give it a try, anyone is welcomed in jumping in and correct, if necessary, my code.
|
|
|
|
|
don't know, but here is a link to a read only combobox
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2659&lngWId=10
|
|
|
|
|
don't know. try this instead:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2659&lngWId=10
|
|
|
|
|
If your Web application runs in an intranet environment any a person can access resources using Windows integrated security. In this strategy, all users are authenticated as soon as they log on to Windows. The authentication process generates a “token” containing information for that user. (The token does not contain the user's credentials, only a code indicating that the user has been authenticated.) The Web application can use the token when requesting a local resource. For example, a logged-in user requests a Web Forms page in Internet Explorer. The request is passed to Internet Information Services (IIS) and then to ASP.NET, which can use the user's authentication token to request access to a file on the server computer.
What I want is to access a resource on web application not by my token but by xxx (any valid network user) token, for that I have to create xxx’s token within my code, this is usually done by using operating system classes and API’s . If anyone has any idea about this please reply.
Regards , Fi
farazz
|
|
|
|
|
I use raw data printing in an accountancy program. XP Clients has no problem with that , but i cannot print any report from Windows me client..
And i use Oki 520 and 310 printers, they have three mode for Fonts ("NLQ","HSD","UTILITY") to print. But i cannot choose which one will be used when printing. I s there any method. Thank you.
|
|
|
|
|
You'll probably have to change your code to support printing to an LPT port. Remember LPT1? Windows Me (yuk! I need to rinse my mouth out now...) doesn't have the hardware abstraction layer that keeps you from printing directly to a port in NT Kernel O/S's.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can you show me a way how to do? I have no IDEA , do u know any article
|
|
|
|
|
Well, you can't use FileStream to DIRECTLY open LPT1, but you can get around this. FileStream has a constructor that accepts any Win32 file handle. You'll have to P/Invoke the Win32 API function CreateFile to open LPT1. It'll return a handle as an IntPtr. You can then use that handle with the FileStream class to write your data to LPT1.
See this[^] for a code sample.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm a VB.NEt programmer and I came accross the Directx 9 sdk. all i wanted was to create a fast vector based gis application. and i ended up asking.. 'Why am i Using VB.nEt. when I can use C#.'
can somebody enlighten me why we stick to vb.net when it seems that c++, java, c# share too many common characteristic that vb.net do not. are we 'vb dudes' being left behind?
still want to use vb though.
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
What makes you think VB.NET is being left behind?
Just because the DirectX SDK doesn't have VB.NET samples in it?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how to programming chess game in vb.net.
Byambatsogt
-- modified at 23:53 Thursday 13th October, 2005
|
|
|
|
|
bitgii xachin ym yariad bai ;P
jghjgjgjgjghjgjgjg
|
|
|
|
|
Obvious, you write a bunch of code!
For such a generic question, I would suggest Googling for "Chess open source" projects. You'll find a bunch of them and you can even see the source code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here is the sample code:-
I was accidently add a line KeyAscii = 0 and then the Beep sound is off.
Question:
1) Why after add a KeyAscii = 0 and then the VB wont sound the Beep?
2) What causing the Error that VB sound the Beep?
Create 2 TextFields on your form. you are welcome to try.
Text1 = txtBegin
Text2 = txtEnd
//-- BEGIN Form1 --
Private Sub txtBegin_GotFocus()
txtEnd.Text = ""
End Sub
Private Sub txtBegin_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
txtEnd.SetFocus
txtEnd.Text = "Here"
'Without the following statement the Beep will sound.
KeyAscii = 0
End If
End Sub
Private Sub txtEnd_GotFocus()
txtBegin.Text = ""
End Sub
Private Sub txtEnd_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
txtBegin.SetFocus
txtBegin.Text = "Here"
KeyAscii = 0
End If
End Sub
//-- END Form1 --
David
|
|
|
|
|
It is normal for a single line textbox to beep, it indicates that the textbox does not accept an enter. Multiline textboxes do not beep.
When you intercept the keypress, you get to it before the beep has occured. The keyascii value stores the ascii value for the keypressed, this is 13 for the enter key. If you don't change it, then the normal windows behaviour will occur - it detects the keyascii 13 and beeps. If you change it to 0 (ascii null) then windows will not beep at you.
|
|
|
|
|
How to prevent from "Sub Script Out Of Range Error" while accessing an array of user defined type.
Type CL
H As String
V As String
End Type
Dim InsCL() As CL
If IsNull(InsCL) Then
'Redim Preserve...
End If
IsNull(InsCL) causes Error as
"Only User Defined Types defined in public object modules can be corrected to or from a variant or passed to late-bound function"
Shoaib Nawaz
|
|
|
|