|
ok, this was the answer,
Your User Agent String is:
Mozilla/4.0 (compatible, MSIE 7.0, Windows NT 6.1; WOW64; Trident/7.0; SLCC2;. NET CLR 2.0.50727;. NET CLR 3.5.30729;. NET CLR 3.0.30729; Media Center PC 6.0;. NET4. 0C;. NET4.0E; InfoPath.3), simulated in IE7 and the same thing happened, then the problem is there, I have to force the webbrowser to simulate a more recent version of IE, I have the latest version on my machine. How do you know?
thank you
|
|
|
|
|
thank you very much.
this link shows the resolution the problem was the same, he simulates previous version, I forced him to simulate the current version
http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
thank you very much
|
|
|
|
|
Hi,
I’ve one issue which is causing a problem at production. I’ve web service written in ASP.net and issue is related to the session management. When there are 2 or more session running simultaneously then application is not able to detect the subsequent requests from respective sessions and responding the data of one session to the other session’s request. This is happening randomly so there is no certain way to produce it. The way I have done the session coding is to create session when user login’s and store its respective data in session so that when that data is required it should respond it quickly and not fetching data from backend at that time. I cannot afford to avoid the session and send new request to back end all the time. Most of our applications are working on same architecture. When login function is called then first I empty the session variable and then after successful authentication I create new session and stores the data in it.
Please let me know, how I can resolve this issue. Any help is greatly appreciated.
Thanks,
Ruchika
|
|
|
|
|
You would have better luck asking in the ASP.NET forum.
|
|
|
|
|
Hi all, I am using the following code to change startup type of a windows service.
string MyserviceName = "Test Service1";
ServiceController servicen = new ServiceController(MyserviceName);
string ServiceName = servicen.ServiceName.ToString();
string startupType = "Automatic";
ManagementPath myPath = new ManagementPath();
ManagementBaseObject outParams = null;
myPath.Server = System.Environment.MachineName;
myPath.NamespacePath = @"root\CIMV2";
myPath.RelativePath = "Win32_Service.Name='" + ServiceName + "'";
using (ManagementObject service = new ManagementObject(myPath))
{
// Set startmode to Automatic (auto start at boot )
ManagementBaseObject inputArgs = service.GetMethodParameters("ChangeStartMode");
inputArgs["startmode"] = startupType;
outParams = service.InvokeMethod("ChangeStartMode", inputArgs, null);
}
But, I am getting a InvalidCastException as "Specified cast is not valid" error at service.GetMethodParameters("ChangeStartMode");
Please help me.
|
|
|
|
|
Odd. I see nothing wrong with that line of code. Are you certain the exception is at that line?
/ravi
|
|
|
|
|
am run this web application popup open in unable to start debugging
please help me
|
|
|
|
|
Do not post the same thing in multiple places: it duplicates work and that annoys people.
You have this posted in QA, leave it there.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
As mentioned, please do not cross-post. However, no one can help until you give the full error. If you google the error you'll see there are many reasons the error can happen. You'll need to go through the various reasons to figure it out.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Ok, so I play a game called neverwinter nights, that has a good modding community.
They created this plugin based server addon called nwnx, which is wrote in c++ code, and allows the invoking/calling of internal nwnserver methods with the desired arguements.
The community were able to build this because bioware were kind enough to release an idb (symbols database) for decompiling the nwnserver program.
This allows us to know the exact memory locations of methods within the server application.
My question is this:
If I have memory offsets of the methods, is there anyway to bind a c# method to those locations, and invoke them from a c# program.
I am aware of appdomains and protection, but I believe I have a way around that.
I have my own nwnx plugin,that allows me to call c# code from the c++ code.
The problem with this is that its a one way call.
Once the nwn -> nwnx -> c# code is executed, it has no way of calling back from c# -> nwnx -> nwn
The good news is that all these dll plugins, are run inside the nwnserver process through dll injection.
So the appdomain protection should be bypassed.
So the question - can I, given the method locations are known, invoke them from c# code, and if so, can someone give me an example
Eg:
Given a c++ method signature of
void (__thiscall *CNWSCreature__PossessCreature)(CNWSCreature *pTHIS, nwn_objid_t oidPossessee) = (void (__thiscall*)(CNWSCreature *pTHIS, nwn_objid_t oidPossessee))0x004CD1B0;
How would I go about binding 0x004cd1b0 to a method that I can invoke in my c# code.
I know reflection can accomplish something similar with objects created in vbScript through the getref method.
eg
objRef.GetType().InvokeMember("", System.Reflection.BindingFlags.InvokeMethod,
null, objRef, args);
|
|
|
|
|
|
Is it possible to specify this as an attribute parameter for PInvoke? This should be compile time binding if possible.
|
|
|
|
|
Hi All
I knew the basic use of it(to use it with base methods so that use can override them in derived classes.)
But what is the use of overriding a method in derive class. We also achieve the same by creating another function too in the derive class.
Please let me know the real advantages of using virtual in base class.
Regards
Varun
|
|
|
|
|
Simple: if you specify virtual when your base class creates a method, then it can (but doesn't have to be) overridden in the derived class.
Lets take an example: a Fruit class.
If you create a virtual Peel method which uses a knife to cut away the peel, you can override it in your derived Apple class to use an apple peeler - because it does a better job. And in your Orange class to just use your fingers.
But in all cases, you just call the Peel method from other code and it doesn't need to worry about which actual method is used. Just as if I threw you a paper bag containing a piece of fruit and told you to "peel that". You would open the bag, and decide on the best method to use to do it - knife, peeler or fingers - as a result of which fruit you found: A Mango would need a knife, an Apple a peeler, and an Orange your fingers.
When you use virtual in your base class, the system will use the most-derived version:
public class Fruit
{
public virtual void Peel(){Console.WriteLine("Knife");}
}
public class Orange : Fruit
{
public override void Peel()
{
Console.WriteLine("Fingers");
}
}
public class Apple : Fruit
{
public override void Peel()
{
Console.WriteLine("Peeler");
}
}
public class Mango : Fruit
{
}
And so
Orange o = new Orange();
Apple a = new Apple();
Mango m = new Mango();
Fruit f = new Fruit();
o.Peel();
a.Peel();
m.Peel();
f.Peel();
f = o;
f.Peel(); Will give you:
Fingers
Peeler
Knife
Knife
Fingers Without you having to look at what type of Fruit it is and calling the appropriate Peel method yourself.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Thanks
Main answer to my question lies in your last line.
"Without you having to look at what type of Fruit it is and calling the appropriate Peel method yourself."
Please let me know if there are any other advantages too.
|
|
|
|
|
|
Hi everyone,
I am writting an program in C#, that use SQL Server database.
My program include a blank database (sample database) that allow users can create a new database.
For example:
- User 1 use my program to create a new database (DB1) on his computer, then he import/enter some data into DB1
- User 2 use my program to create a new database (DB2) on his computer, then he import/enter some data into DB2
Now, I have both two database (DB1, DB2). Do you know how to merge/combine two databases to have unique database that contain all users' data ?
Can you help me ?
Thank you very much,
Tai
|
|
|
|
|
|
i´m trying to bind a list to a datagridview. i do that:
public void seedatagrid(List<myClass> liste2)
{
dgv_TraceItems.DataSource =liste2;
}
and the datagridview has the data, but it doesn´t show anything.
could you help me?? how can i resolve the problem?? thank you
the class
public enum TYPE
{
normal= 1,
especial= 3,
low= 6,
high= 7,
}
public class myClass : INotifyPropertyChanged
{
private byte number;
private TYPE type;
private string file;
private bool isselected;
public event PropertyChangedEventHandler PropertyChanged;
public byte Number
{
get
{
return this.number;
}
set
{
this.number= value;
this.OnPropertyChanged("Number");
}
}
public TYPE Type
{
get
{
return this.type;
}
set
{
this.type = value;
this.OnPropertyChanged("Type");
}
}
public string File
{
get
{
return this.file;
}
set
{
this.file = value;
this.OnPropertyChanged("File");
}
}
public bool IsSelected
{
get
{
return this.isselected;
}
set
{
this.isselected = value;
this.OnPropertyChanged("IsSelected");
}
}
public myClass(UInt32 Data, string Text)
{
this.number = (byte)((Data & 0x0000FF00) >> 8);
this.type = (TYPE)((Data & 0x00FF0000) >> 16);
this.file = Text;
}
private void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
i have tried to make a datatable with the list and the datagridview doesn´t show anything. i don´t know what happends , but i have a problem with the datagridview
|
|
|
|
|
Some things to look at:
* is it Asp.Net? I remember back in the days you also had to call the databind method. Not sure if it changed in newer versions.
* Is the datagridview "aligned" with the source you put into it? IOW the values of the class are not appended at the end of the grid (column wise) or the datagridview doesn't know what to do with the properties you're putting in? In short, you're pumping in a block of data, but you need to tell the datagridview what parts of the data are for which column.
Hope this helps.
|
|
|
|
|
ok, i understand you say,but i don´t know how to make it, hehe
how can i tell the datagridview what parts of the data are for which column?
with a list or with a datatable there is a problem with the datagridview.
because if a make a datatable with the list (all as string) and after i send the datatable to the datagridview, and the datadrigview doesn´t show anything. what problem is??
thank you
|
|
|
|
|
If you haven't defined any columns in the designer it should do this for you, no problems. If you did define columns I guess you also need to define the "link" to the data you're attaching. You can do this in the designer and in code I guess (it's been a while since I did this).
I would try to find some samples on MSDN.
|
|
|
|
|
i have definde any columns, but i tried too columns definded, but it´s the same.
any sample would be helper
thank you
|
|
|
|
|
I would try to find some samples on MSDN.
|
|
|
|
|
i have definde any columns, but i tried too columns defined, but it´s the same.
any sample would be helper
thank you
|
|
|
|