|
Good to hear..
Regards
Mick Curley
|
|
|
|
|
okay i read the input from the text box as a char array.. then i've put if conditions that check for whitespaces, comments, strings, digits,
but it always skips which means that the comments then lie in the strings bit and so on...
please tell me where i went wrong here .
thankyou
#region Scanner
for (int i = 0; i < readInput.Length; i++)
{
char x = readInput[i];
#region Whitespace
if (char.IsWhiteSpace(x))
{
continue;
}
#endregion
#region stringliteral
else if (x == '"')
{
i++;
StringBuilder adder = new StringBuilder();
do
{x = readInput[i];
MessageBox.Show(x.ToString() + "testing");
adder.Append(x);
i++;
if (i == readInput.Length)
{
MessageBox.Show("WRONG");
break;
}
} while (x != '"' && i < readInput.Length);
whole.Add(adder);
}
#endregion
#region syntax
else if (char.IsLetter(x) || x == '_' && x!='"')
{
StringBuilder adder = new StringBuilder();
do
{
x = readInput[i];
MessageBox.Show(x.ToString() + "Letter Only");
adder.Append(x);
i++;
if (i == readInput.Length)
{
break;
}
} while ((char.IsLetter(x) || x == '_' && x!='"') && i < readInput.Length);
whole.Add(adder);
}
#endregion
#region digitliteral
else if (char.IsDigit(x))
{
StringBuilder adder = new StringBuilder();
do
{x = readInput[i];
MessageBox.Show(x.ToString() + "Is Digit");
adder.Append(x);
i++;
if (i == readInput.Length)
{
break;
}
}
while (char.IsDigit(x) && i < readInput.Length);
whole.Add(adder);
}
#endregion
#region comments
else if (x == '$')
{
i++;
x = readInput[i];
do
{
MessageBox.Show(x.ToString() + "testing comments");
i++;
if (i == readInput.Length)
{
MessageBox.Show("WRONG");
break;
}
x = readInput[i];
} while (x != '\n' && i < readInput.Length);
}
#endregion
}
#endregion
|
|
|
|
|
canatan wrote: else if (char.IsLetter(x) || x == '_' && x!='"')
I'm not sure this is correct. I mean, if x = ", then it can't equal _ or a letter, right ? I suspect you at least want to add some brackets. Then I'd step through it to work out what's going wrong.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
its
else if((char.IsLetter(x)||x=='_')&&(x!='"'))
okay so i think i fixed the digit bit but it causes problems elsewhere
<pre> #region digitliteral
else if (char.IsDigit(x)) // checking for digits
{
StringBuilder adder = new StringBuilder();
while (char.IsDigit(x) && i < readInput.Length)
{
MessageBox.Show(x.ToString() + "Is Digit");
adder.Append(x);
i++;
if (i == readInput.Length)
{
break;
}
x = readInput[i];
}
whole.Add(adder);
i--;
MessageBox.Show(adder.ToString()+readInput[i]);
}
#endregion
now all the digits come out right .. but the " is still ignored for some strange reason.. and i cant figure out the problem in that.. instead of the " being picked up.. it picks up the letter after the " and uses that instead...
i-- sets i to the last digit and then the loop shud run again which would mean that i should iterate to the next which is a " and hence this should be detected ..
|
|
|
|
|
Have you set a breakpoint and stepped through the code to see where things go wrong ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
thanks i got it
wrote it all out and worked it out
|
|
|
|
|
hi all
i am having a problim to save data in a binary file
binary file i mean if i edit it in notepad i will get
P—|S->\|’>(%x4ˆ}ֹµ%!רצIO׃ֱ1»ֹ4x(™”ףy_A×Gֳז˜‘ LO׀S Bb<<Skק¥"D$¥פƒג8H”ׂlt;ל3’”|w„´IK”ה~*2uOהRRyJ}ׂN¾z$×d8Mּ₪˜#ֱ%2JS&4ך’©‘ו#פ|׃J~tIJ$Bnב)’™נ„”¿ק¥ֲa:₪{‘ק$¥ּ%א`GtrJTר¥:„¾t’R¾=“י Mּ₪JH\B~׃DAR׳lq )sֿqפP5NֹגRRַ@~$צ=<RRַ’˜iֺGRS™I+¦׀'&
i need a function in c# to save the string "http://www.quickapp.co.il/" in binary way
thankX
hamzi
|
|
|
|
|
I think you are very confused. Your string IS being saved in a binary way. I assume you mean that you want to encrypt the string. Use the Cryptography namespace for this.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hello!
I’m trying to build an app, which should have Flash Video Play control, which plays FLV from server (certain URL). For Flash Player ActiveX you have to save the movie to a temporary location to load it and play, isn’t it? You'll have to create a corresponding link that you can pass to the Flash Player ActiveX and then delete the movie after it is played. Of course you can’t guarantee high security level , but I think it’s good, if at least no temporary files are created. So the question is how to make Flash Player ActiveX be able to load flash movies directly from any source without usage of temp files?
Thank you!
|
|
|
|
|
If the ActiveX control doesn't have a method that takes a URL for the file to play, or if you're using that method, and it creates a local file, then I suspect you have your answer.
Just to add - if your Flash player plays a file from the server, then your machine must have access to that file on the server. So, how does it matter if a copy is made locally, or not ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
"Just to add - if your Flash player plays a file from the server, then your machine must have access to that file on the server. So, how does it matter if a copy is made locally, or not ?"
I'm trying to prevent local access to Flash player file by other applications. I think it's also good if Flash player able to play movie during loading, It's would not wait while loading is complete.
|
|
|
|
|
Hi!
My app uses one ActiveX and I don't want to register it under WinXP. Is it possible to use ActiveX without registration?
Thanks!
|
|
|
|
|
Of course not. Why do you think that people register their activeX controls, just for the fun of it ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
So, is there no way at all?
|
|
|
|
|
See this[^]...
I am also searching for the same... But got nothing at the code level.
- ns ami -
|
|
|
|
|
Thanks! BoxedApp - good idea
|
|
|
|
|
See this[^] too...
- ns ami -
|
|
|
|
|
Hello!
For security I should not to use any temporary files except single .exe file. DLLs should be embedded in exe file. Would you, please, advice me how can I load DLLs, used in my app, without extracting them run-time?
Thanks!
|
|
|
|
|
The security benefits of doing this are very limited. What are you trying to stop ? People can decompile your code, change it and recompile it, so....
You can't just embedd a dll in an exe. You need to move the code of that dll into your project.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi , use this ...
ILmerege
I know nothing , I know nothing ...
|
|
|
|
|
If the DLLs aren't going to need to be changed, then you could encode the DLL byte-stream as a base64 string and store it in your Resources section. Then at program startup you could convert the resource into the original byte array and use Assembly.Load to load the DLL from that byte array. Of course, you would need to use the System.Reflection namespace to get access to the members, and this is inherently slower than just adding a reference to your DLL. And there's nothing to stop a cracker from reading the base64 string in your program using .Net Reflector, converting it to a byte array and saving it to a file
Alternatively, you could simply store the classes from the DLLs in your project and build them as a single EXE file
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thank you! Very useful information! I can not only write DLL as string, but I can crypt it as I want
|
|
|
|
|
Hello,
I have 3 forms and 1 button on each one. (form1, form2, form3)
how to code the buttons to go to each form.
I know basically I have to create instance of form and also show and hide.
but don't really understand.
I tried writing form2 newOne = new Form2();
newOne.show();
this.hide();
I was able to click button from Form1 to Form2 but that was all - even when tried to modify.
I must be not doing something.
thank you
|
|
|
|
|
Sounds like you need to read a beginners book. What you've done, kind of works. But, it's not ideal. Ideally, you have your forms as member variables, and if you want to show one and hide the other, the best way to do that is to make them both controls inside the one form.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Thank you for the information
|
|
|
|