|
Because I know how to do it wit the directory and file but I want to do it with database and that is giving me a headache but still want to make one
tank's
|
|
|
|
|
|
I have some ASP.NET Project Files(.aspx and .aspx.cs)in text format[textfile] in a folder
i wanted to open all project files in My Visual studio how can i open?
NOTE:Not like following process
Select File-->openwith-->Visual studio
When we craeted a website we can see 2 files[Web and Web.Debug] in project folder[physical location] What are these files?
|
|
|
|
|
Sandhya Bandar wrote: I have some ASP.NET Then I think it would be better if you posted your question in the ASP.NET forum[^].
Veni, vidi, abiit domum
|
|
|
|
|
Dear Sir,
I create a C# project "The file version maintain utility"
but I can't understand that how to create this project .
Sir I want to code It's project.
So please sir send me code about 'The file version maintain utility'..
my gmail - mukeshsahani002@gmail.com
your faithful
Mukesh
|
|
|
|
|
It's generally a good idea to start off projects by working out what your requirements actually are. You can break these requirements down into steps that satisfy the needs of each part. From these steps, you should be ready to start coding.
At the moment, it sounds like all you have is a name for the project. Unfortunately, no one is going to write this code for you - we're volunteers only; we don't get paid to write your code.
Final point - it's not a good idea to include your email address in a forum. It will end up attracting spam.
|
|
|
|
|
|
Hi! I have a XNA Project with a XNA-game contained inside a winform.
My program.cs looks like this:
Form1 form = new Form1();
form.Show();
Game1 game = new Game1(form.getDrawSurface());
form.Game = game;
game.Run();
I have a setter and a getter in the winfom like this:
Game1 game = new Game1();
public Game1 Game
{
get
{
return game;
}
set
{
game = value;
}
}
So now I can send values from my form to my Game1 in XNA but not the other way around.
How can I send values from XNA to the WinForm?
I have used som solutions I have found on the internet so I don't fully understand everything.
|
|
|
|
|
Create custom events in your Game1 class and subscribe to those events from the game instance in your form
|
|
|
|
|
Thanks.
Can you give me an example? Is it like a method?
|
|
|
|
|
Form1 form = new Form1();
form.Show();
Game1 game = new Game1(form.getDrawSurface());
form.Game = game;
game.GameEvent += HandleGameEvent;
game.Run();
private void HandleGameEvent(object sender, EventArgs e)
{
}
public class Game1
{
public event EventHandler GameEvent;
protected vitual void OnGameEvent(EventArgs e)
{
EventHandler eh = GameEvent;
if(eh != null)
eh(this, e);
}
}
Check out Basic Event Creation in C#[^] and Events Made Simple[^]
|
|
|
|
|
Thanks, it starting to be clear but it isn´t all that simple to me...
So, suppose something happends in my XNA-game.
There is a update-method were I check if the enemy is alive and within range of Another object:
if (!(enemy.IsAlive && (player.X <= enemy.X + 100) && (player.Y <= enemy.Y + 50 || player.Y >= enemy.Y + 50)))
isActivated = false;
if (enemy.IsAlive && (player.X <= enemy.X + 100) && (player.Y <= enemy.Y + 50 || player.Y >= enemy.Y + 50)) {
if ((depthChargeX >= enemyX - 50 && depthChargeX <= enemyX + 50) || (depthChargeY >= enemyY - 50 && depthChargeY <= enemyY + 50) && isActivated == true)
{
enemy.IsAlive = false;
hit.Play();
wreck2.IsAlive = true;
wreck2.Update(gameTime);
}
}
If it isn´t in range I want to send a bool or something to my form so I can e.g. enable or disable a button.
Would I then send that bool to the OnGameEvent or must I create a new class like in one in one of the examples. I am a little confused still I must admit.
But I suppose the HandleGameEvent in the form listens to the event raised.
And
game.GameEvent += HandleGameEvent;
Is where you subscribe to the event raised by the game.
I also get: The name 'HandleGameEvent' does not exist in the current context but I suppose something is missing.
|
|
|
|
|
larsp777 wrote: The name 'HandleGameEvent' does not exist in the current context but I suppose something is missing You are missing the event handler itself. Assuming that it just passed across EventArgs, the handler would look like this:
private void HandleGameEvent(object sender, EventArgs e)
{
} larsp777 wrote: If it isn´t in range I want to send a bool or something to my form so I can e.g. enable or disable a button. A simple event args class that looks like this should help:
public class GameRangeEventArgs : EventArgs
{
public GameRangeEventArgs(bool isInRange) : base()
{
IsInRange = isInRange;
}
public bool IsInRange { get; private set; }
} Now, in your Game, you would declare this as:
public event EventHandler<GameRangeEventArgs> GameRangeEvent; To use this from your game code, I would typically have a helper method that looks like this:
private void RaiseGameRangeEvent(bool isInRange)
{
var handler = GameRangeEvent;
if (handler != null)
{
handler(this, new GameRangeEventArgs(isInRange));
}
} Now, in your code you simply call this method and the event is raised if there is an event handler attached to it in the form. So, what would this look like in the form? Well, you will have something like this:
game.GameRangeEvent += HandleGameRangeEvent;
...
private void HandleGameRangeEvent(object sender, GameRangeEventArgs e)
{
}
|
|
|
|
|
|
Alright, I'm gonna drop this here since I need a .Net specific Regex and I don't know how the .Net Regex engine may affect the expression as whole.
I have a string which is formatted as ASDF@123123 .
The string ASD@F@123123 shall not be considered a valid string, while AS\@DF@123123 shall be considered valid.
What I got so far is (?<=[\\]{2,})(@) which allows me to check whether a \ is leading an @ sign.
The problem starts with the evauluation, I simply can't merge it somehow with (^[^[@\\[\\]\"= \\p{C}]*[@\\d]?$) (which shall do the evaluation of the string as whole).
So, how can I merge (?<=[\\]{2,})(@) into (^[^[@\\[\\]\"= \\p{C}]*[@\\d]?$) ?
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
Why not to break it up
1. letter group -> [A-Z]
1.a with optional \@ -> (\\@)*
2. optional(?) @ -> (@)*
3. numeric group -> [0-9]
[A-Z](\\@)*(@)*[0-9]
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: [0-9]
Let's shorten that to [\d]
[A-Z](\\@)*(@)*[0-9]
Has a single problem with it: Special characters (", Whitespace, dots, commas, hyphens, etc.) are not allowed, e.g.
a_b@123 would be invalid.
Furthermore, \@ would be invalid as well, despite that it is in fact a perfectly valid string.
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
Do you have a full specification of the format you want?
I can come up with something - maybe...
The one I offered here based on my understanding of the sample you gave...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Here you go:
SD-IDs are case-sensitive and uniquely identify the type and purpose
of the SD-ELEMENT. The same SD-ID MUST NOT exist more than once in a
message.
There are two formats for SD-ID names:
o Names that do not contain an at-sign ("@", ABNF %d64) are reserved
to be assigned by IETF Review as described in BCP26 [RFC5226].
Currently, these are the names defined in Section 7. Names of
this format are only valid if they are first registered with the
IANA. Registered names MUST NOT contain an at-sign ('@', ABNF
%d64), an equal-sign ('=', ABNF %d61), a closing brace (']', ABNF
%d93), a quote-character ('"', ABNF %d34), whitespace, or control
characters (ASCII code 127 and codes 32 or less).
o Anyone can define additional SD-IDs using names in the format
name@<private enterprise="" number="">, e.g., "ourSDID@32473". The
format of the part preceding the at-sign is not specified;
however, these names MUST be printable US-ASCII strings, and MUST
NOT contain an at-sign ('@', ABNF %d64), an equal-sign ('=', ABNF
%d61), a closing brace (']', ABNF %d93), a quote-character ('"',
ABNF %d34), whitespace, or control characters. The part following
the at-sign MUST be a private enterprise number as specified in
Section 7.2.2. Please note that throughout this document the
value of 32473 is used for all private enterprise numbers. This
value has been reserved by IANA to be used as an example number in
documentation. Implementors will need to use their own private
enterprise number for the enterpriseId parameter, and when
creating locally extensible SD-ID names.
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
|
This is for sure not gonna work:
1 - Group # 3 & 4 are particularly useless.
2 - You only allow ~ and ! to come before a single @ (not escaped)
3 - Escape characters for [, ], " and @ are not allowed.
Thank you for your help, anyways.
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
According to the RFC the first part can use any ASCII char except control chars (0-31), white-space (32), @, =, " and ]. After that must come a @ (one and only one!). The last part is made of digits optionally separated by . (dot)...
At least that what I understood...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: char except control chars (0-31), white-space (32),
true, but your regex only allows ! and ~
Kornfeld Eliyahu Peter wrote: @, =, " and ].
They must be escaped, e.g. @ as \@.
Kornfeld Eliyahu Peter wrote: After that must come a @ (one and only one!).
true that
Kornfeld Eliyahu Peter wrote: The last part is made of digits optionally separated by . (dot)...
Well... Yes. Sorry that I overread that.
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|
|
Marco Bertschi wrote: true, but your regex only allows ! and ~
Wrong. I have [!-~] - it means everything from ! to ~
Marco Bertschi wrote: They must be escaped, e.g. @ as \@.
According to RFC they are can't take part - no mentioning of escapes!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: According to RFC they are can't take part - no mentioning of escapes!
My bad, I forgot to paste the respective part.
Quote: Inside PARAM-VALUE, the characters '"' (ABNF %d34), '\' (ABNF %d92),
and ']' (ABNF %d93) MUST be escaped. This is necessary to avoid
parsing errors. Escaping ']' would not strictly be necessary but is
REQUIRED by this specification to avoid syslog application
implementation errors. Each of these three characters MUST be
escaped as '\"', '\\', and '\]' respectively. The backslash is used
for control character escaping for consistency with its use for
escaping in other parts of the syslog message as well as in
traditional syslog.
A backslash ('\') followed by none of the three described characters
is considered an invalid escape sequence. In this case, the
backslash MUST be treated as a regular backslash and the following
character as a regular character. Thus, the invalid sequence MUST
not be altered.
Clean-up crew needed, grammar spill... - Nagy Vilmos
|
|
|
|