|
I rather suspect you don't have a clue what you are talking about. How do you plan to use vb.net with c#? They are two different languages.
However, post what you have tried and someone may figure out what you are trying to do.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
|
Thats interesting for something which has 2 diff. languages, I would like to test this one out.
|
|
|
|
|
Hi,
I want to change the javascript parameter value in c# like this.
var t = 123;
window.external.Test(t);
alert(t);
public void Test(ref int TT){
TT = 456;
}
I find another way to change it by use object like this
function MyTestClass(){
this.A = "123MyTestClass";
}
var t = new MyTestClass();
window.external.Test(t);
alert(t.A);
public void Test(object TT){
object s = TT.GetType().InvokeMember("A", BindingFlags.SetProperty, null, TT, new object[] { "mynewvalue" });
}
Then t.A is changed.
How can I change javascript value is c# code without object?
|
|
|
|
|
Are you working in website ???
I think in Web environment, Server and clients are different. Javascript have access to the client objects(Limited) while C# works with server objects.
The Bridge between server and client is made using Request and Response.
So if you want to set the value of a javascript function just write it to the Response... Simple.. (For example, create a hidden field and set the value, or Directly place anywhere and parse the body text using javascript).
|
|
|
|
|
I'm working in winform project.
I used a webbrowser in the form. The webbrowser load a html file with javascript. In the javascript, it can call external method use "window.external.???".
The cs code like this
[code]
namespace TestA
{
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitStart();
}
private void InitStart()
{
webBrowser1.Url = new Uri(AppDomain.CurrentDomain.BaseDirectory + "test.htm");
webBrowser1.ObjectForScripting = this;
}
public void TestB(ref int TT)
{
TT = 345;
}
public void Test(object TT)
{
object s = TT.GetType().InvokeMember("A", BindingFlags.SetProperty, null, TT, new object[] { "mynewvalue" });
}
}
}
[/code]
The html file like this
[code]
<script language="javascript" type="text/javascript">
function MyTestClass(){
this.A = "123MyTestClass";
}
var t = new MyTestClass();
window.external.Test(t);
alert(t.A);
//可以修改
var t = 123;
window.external.TestB(t);
alert(t);
//无法修改
</script>
[/code]
|
|
|
|
|
I hav created a program and i need to convert d source code into .exe file so as to make it platform-independent.can u please help me how to do this.
|
|
|
|
|
shakins wrote: I hav created a program and i need to convert d source code into .exe file so as to make it platform-independent.can u please help me how to do this.
This is not possible; an exe file is compiled for a specific target platform. You need to make the source platform independent and then compile that source on each platform that you want to run it on, to create a compatible object.
|
|
|
|
|
|
zaksoftwaredeveloper wrote: You need a .NET Reflector
How will that help to make a program platform independent?
|
|
|
|
|
He wasn't replying to the OP, he was replying to you. Perhaps he just thinks you want Reflector and have forgotten where it is now since Lutz sold it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: Perhaps he just thinks you want Reflector
Still
|
|
|
|
|
If you've written your application in .NET, then it's not platform independent. It will only run in Operating Systems that have the .NET framework. You could possibly compile against Mono, but that still isn't platform independent, for instance it won't run on an old VAX server.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
shakins wrote: convert d source code into .exe
You'll need a d compiler. Very few people here use d.
shakins wrote: make it platform-independent
That's unachievable.
|
|
|
|
|
Hi -
I'm looking to automate the switching on/off of my 2nd monitor.
I can do it manually, via the Windows Desktop/Properties dialog. Is there a API or baseclass that can do this?
Any help is appriciated!
Thanks,
Bill
|
|
|
|
|
hi , i want to develop an application where one person will share screen with several people joining the conference , just need some help for start up. please share some links or help code to begin with.
with regards
|
|
|
|
|
Hi friend,
I also want to develop screen sharing application.
if u got any help or link or code please send me.
|
|
|
|
|
What is a recommended means of storing an expression/formula in a database field, to be evaluated at runtime in a report. The reporting Engine will likely be Telerik or SSRS. I have several production performance categories, measured in tons, count, percentage etc. that all must be able to have a unique formula for calculating the performance rating, in the appropriate unit of measure.
|
|
|
|
|
Write the expression in the database and during the evaluation of the formulas, use Infix to Postfix or Prefix and then evaluate.
|
|
|
|
|
I had download a online website. when i running site on local.I found the error:
"The virtual path '/Templates/mysite/Main.master' maps to another application, which is not allowed."
plz help me.
Thanx
uttam
uuttam.xevoke@live.com
|
|
|
|
|
uttam kr wrote: plz help me.
What do you want help with? You haven't asked anything only made the statement that you copied someone else's work and can't figure out how to do it on your own.
only two letters away from being an asset
|
|
|
|
|
I'm trying do run the Ole DB below with OleDBCommand but I'm getting a strange error, OleDB doesn't have some functions implemented?
SELECT
[Plan1$].[Cliente] AS [Cliente0],
CONVERT(varchar, DATEPART(q,[Plan1$].[Data]) % 2 + 1) + 'S/' + DATENAME(yyyy,[Plan1$].[Data]) AS [Data1]
FROM [Plan1$]
ORDER BY [Plan1$].[Cliente] ASC, [Plan1$].[Data] ASC
ConnectionStr: Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\works\Clientes.xls";Extended Properties="Excel 8.0;HDR=YES;"
Error: System.Data.OleDb.OleDbException: Sintax error 'CONVERT(varchar, DATEPART(q,[Plan1$].[Data]) % 2 + 1) + 'S/' + DATENAME(yyyy,[Plan1$].[Data])'.
|
|
|
|
|
Hi, Is there not a VB6 forum here? please direct me where to find it as my question is related to VB6.
I'm connecting client to server using VB6 Winsock Controls
'==========Server side============================
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemoteHost = strParm(0)
Winsock1.RemotePort = 1002
Pause (7)
MsgBox "Before Connecting" 'just to do something, and give time to establish connection
Winsock1.Connect
MsgBox "After Connecting"
DoEvents
'Delay2 = 1
Pause (10)
Winsock1.SendData ("Starting dropship refresh...")
It works fine with the MsgBox between the Connect and the Senddata, but without it gives an error when firing Senddata method, seems because connection is not established quick enough.
Please help, how can I ensure connection before sending data?
I have tried some 'delay' processes which works 1 minute and doesnt the next.
Thanks in advance
P
|
|
|
|
|
There is a Visual Basic forum.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
VB6 has some rudimentary error-handling. Wait a sec, try to connect, and if it fails then try again in two seconds. Repeat for three to five times, and show a message that there's connectivity-problems if you cannot connect after that.
I haven't got a VB6-IDE at home, but this should give you a basic idea;
Private Sub WaitForAwhile(howLong as Int)
Dim currentTime
currentTime = timeGetTime
While (timeGetTime - currentTime) < howLong
DoEvents
Wend
End Sub This should allow a pauze while processing continues. Next, to the connection-routine;
Private Sub TryConnect()
On Error Goto myErrorHandler
Dim Tries%
Tries% = 0
TryAgain:
Winsock1.Connect
WaitForAwhile(1000)
Winsock1.SendData ("I will gladly beam down to the planet, Captain!")
Exit Sub
myErrorHandler:
Tries% = Tries% + 1
If Tries% < 5 Then
Goto TryAgain
Else
MsgBox "Cannot connect, try the sneakernet :)"
End If
End Sub
I are Troll
|
|
|
|