|
Have you tried renaming the extension to zip, assuming it is a zip format.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It depends which particular .pkg format you are trying to extract. Is it the Apple file format or the Playstation download content format? These are proprietary file formats, and not straightforward zip files. I'd have to wonder why you were trying to open either of these up.
|
|
|
|
|
DevExpress GridView conditional coloring with the query you want to do after filling.
The following code loops but affects all rows, where the problem might be.
for (int i = 0; i < gridView1.RowCount; i++)
{
int val = Convert.ToInt32(gridView1.GetRowCellValue(i, "MEMBERID"));
if (val==2)
{
gridView1.Columns["MEMBERID"].AppearanceCell.BackColor = Color.Red;
}
else
{
gridView1.Columns["MEMBERID"].AppearanceCell.BackColor = Color.RoyalBlue;
}
}
|
|
|
|
|
Hi there,
I created a solution with multiple projects (for a game, different levels).
I have a start screen, and when you click the "Start button" i want them to open another solution, how can i do something like that?
Thanks,
Robin
|
|
|
|
|
say you have 2 projects in the solution:
where
1. project1 is the startup project: right click project > set up as startup project)
2. project1 is depending on project2:
right click solution > project dependencies > choose project1 depends on project2
3. create a form in project2 called project2form1
4. create a form in project1, add a button1 and a button1_click event that call the project2form1 to show:
private void button1_Click(object sender, EventArgs e)
{
project2.project2form1 frm = new project2.project2form1();
frm.Show();
}
The End.
|
|
|
|
|
Hi,
Thanks for your reply, but in my project is only project 1 a form, the other projects are MonoGame, how can i do it then?
I've tried this:
MiniGame_PressRedButton.Game1 game1 = new MiniGame_PressRedButton.Game1();
game1.Show();
But that results in this error: Error 1 The type or namespace name 'MiniGame_PressRedButton' could not be found (are you missing a using directive or an assembly reference?)
Thanks
modified 8-Apr-14 10:11am.
|
|
|
|
|
Code Server :
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
IPAddress[] localip = Dns.GetHostAddresses(Dns.GetHostName());
foreach (IPAddress address in localip)
{
if (address.AddressFamily == AddressFamily.InterNetwork)
{
textBox1.Text = address.ToString();
textBox2.Text = "8888";
}
}
}
private void button1_Click(object sender, EventArgs e)
{
TcpListener listenner = new TcpListener(IPAddress.Any, int.Parse(textBox2.Text));
listenner.Start();
tcpclient = listenner.AcceptTcpClient();
}
Code client :
namespace CLIENT
{
public partial class Form1 : Form
{
private TcpClient tcpclient;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
labelmessage.Visible = false;
}
private void button1_Click(object sender, EventArgs e)
{
tcpclient = new TcpClient();
IPEndPoint ipe = new IPEndPoint(IPAddress.Parse(textBox1.Text), int.Parse(textBox2.Text));
try
{
tcpclient.Connect(ipe);
if (tcpclient.Connected)
{
labelmessage.Visible = true;
labelmessage.Text = "Conected...";
}
}
catch
{
}
}
}
}
|
|
|
|
|
And what exactly is your question?
|
|
|
|
|
hi all,
i was searching an article on how to implement roles system in my winform c# application, so i find the same question: user roles management in c# windows application[^]
I understand from this article that I can use Membership and Role provider so I revise this course specific to ASP .NET :
ASP.NET Membership and Role Provider[^]
I want an article/course/code/explanation on how to use this into my winform application (app.config)
I use MySql and C#
|
|
|
|
|
I apologize for my bad english (google translate),
With this code, I can see the dates for this week : but I do not see next week and the previous week, please help
DateTime dt = DateTime.Now;
int a = (int)dt.DayOfWeek;
if (a == 0) a = 7;
DateTime monday_day = dt.AddDays(1 - a);
DateTime tuesday_day = dt.AddDays(2 - a);
DateTime wednesday_day = dt.AddDays(3 - a);
DateTime thursday_day = dt.AddDays(4 - a);
DateTime friday_day = dt.AddDays(5 - a);
DateTime saturday_day = dt.AddDays(6 - a);
DateTime sunday_day = dt.AddDays(6);
monday_lbl.Text = monday_day.ToShortDateString();
tuesday_lbl.Text = tuesday_day.ToShortDateString();
wednesday_lbl.Text = wednesday_day.ToShortDateString();
thursday_lbl.Text = thursday_day.ToShortDateString();
friday_lbl.Text = friday_day.ToShortDateString();
saturday_lbl.Text = saturday_day.ToShortDateString();
sunday_lbl.Text = sunday_day.ToShortDateString();
----------------------
|
|
|
|
|
|
ty man, I guess I was looking for this code, but there are a lot of code I don't understand
|
|
|
|
|
It's all pretty simple, I thought. What parts are difficult? I may be able to explain them, or change the tip to be clearer to others.
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 – ∞)
|
|
|
|
|
I just next to the label and I want you to write the history of the previous week, but these mixed. ty
|
|
|
|
|
Sorry, but I don't understand what you are saying.
Could you try saying that again, but in a different way?
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 – ∞)
|
|
|
|
|
|
Not too complex:
Next week (starting Saturday) is Next Saturday (there is a method for that in the link).
From that, as a DateTime, you can work out the whole of the week by using teh standard DateTime.AddDays method.
From the Saturday, you can also work out last week: Next Saturday and use AddDays again, with -14 as the add on value. You can then use AddDays again to work through the week.
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 – ∞)
|
|
|
|
|
yes, I can see it with code dates next week, how can I make the loop, but how,
DateTime dt = DateTime.Now;
int a = (int)dt.DayOfWeek;
if (a == 0) a = 14;
DateTime pazartesigun = dt.AddDays(8 - a);
DateTime saligun = dt.AddDays(9 - a);
DateTime carsambagun = dt.AddDays(10- a);
DateTime persembegun = dt.AddDays(11- a);
DateTime cumagun = dt.AddDays(12 - a);
DateTime cumartesigun = dt.AddDays(13 - a);
DateTime songun = dt.AddDays(14-a);
pazartesilbl.Text = pazartesigun.ToShortDateString();
salilbl.Text = saligun.ToShortDateString();
carsambalbl.Text = carsambagun.ToShortDateString();
persembelbl.Text = persembegun.ToShortDateString();
cumalbl.Text = cumagun.ToShortDateString();
cumartesilbl.Text = cumartesigun.ToShortDateString();
pazarlbl.Text = songun.ToShortDateString();
|
|
|
|
|
This may be a translation problem, but you can't make that code into a loop, unless you create an array of labels - containing pazartesilbl, salilbl ... in the order you want to display them.
Which I think you know...so what is it you are trying to get help with?
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 – ∞)
|
|
|
|
|
Can I send the program solves the problem?
|
|
|
|
|
No - but if it's solved, why would I need it anyway?
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 – ∞)
|
|
|
|
|
|
I'm not looking at that: I don't download and run EXE files from unknown websites!
And particularly when they are "download managers"...
I'm not surprised it doesn't change any dates when you press a button - you are using DateTime.Now, so at best it will be a week before anything changes!
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 – ∞)
|
|
|
|
|
area code next week dates this. now you need the area code of the previous week dates
DateTime strtdt = DateTime.ParseExact(mondaylbl.Text, "dd/MM/yyyy", null);
GregorianCalendar cal = new GregorianCalendar(GregorianCalendarTypes.Localized);
int week = cal.GetWeekOfYear(strtdt, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
int year = strtdt.Year;
DayOfWeek day = DayOfWeek.Monday;
DateTime startOfYear = new DateTime(year, 1, 1);
int daysToFirstCorrectDay = (((int)day - (int)startOfYear.DayOfWeek) + 7) % 7;
DateTime FirstDay = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay);
DateTime sonrakiikincigun = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay).AddDays(1);
DateTime sonrakiucuncugun = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay).AddDays(2);
DateTime sonrakidorduncugun = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay).AddDays(3);
DateTime sonrakibesincigun = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay).AddDays(4);
DateTime sonrakialtincigun = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay).AddDays(5);
DateTime Endaday = startOfYear.AddDays(7 * (week - 1) + daysToFirstCorrectDay).AddDays(6);
mondaylbl.Text=FirstDay.ToString("dd/MM/yyyy");
tuesdaylbl.Text = sonrakiikincigun.ToString("dd/MM/yyyy");
wednesdaylbl.Text = sonrakiucuncugun.ToString("dd/MM/yyyy");
thursdaylbl.Text = sonrakidorduncugun.ToString("dd/MM/yyyy");
fridaylbl.Text = sonrakibesincigun.ToString("dd/MM/yyyy");
saturdaylbl.Text = sonrakialtincigun.ToString("dd/MM/yyyy");
sundaylbl.Text=Endaday.ToString("dd/MM/yyyy");
|
|
|
|
|
OK - a quick check says that works. I put a date in monday, press the button, I get a monday, and so forth.
What's the problem?
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 – ∞)
|
|
|
|