|
Hi,
Thanx for replying,i am sure that i have given the right path i have checked many times.
Is there is any other way to do the upload.
|
|
|
|
|
In that case, I'd use something like EtheReal to watch the TCP traffic coming out of your machine and see what the FtpWebRequest is actually sending to the FTP server.
|
|
|
|
|
1)A program returns a long string like the strings below, delimited by pipe character, where errorcode, error details, and long reason are stored. Write c# code to get the long code out of the response received.
0|R002|this is not a valid transaction.
1|R003|the card has expired.
2|R004|card code is invalid.
2)
a. table tblcode has codes like the following
CUPA0001
CNOI0001
CUPA0002
CNOI0003
CDEL0001
b. objective is to get the next code given the three digits unique code.e.g. Given DEL, NOI, UPA the next code is CDEL0002, CNOI0004, and CUPA0003
write a function in sql server to achieve this .the function will get input parameter as, city code in 3 characters e.g. DEL,NOI,UPA and should return the next code as per logic above
|
|
|
|
|
never use the word "Plz solve the prob its very urgent"
this may be urgent for u ..
but be cool to be silent so tht let others read and answer u
Good day
TJS
|
|
|
|
|
ok
thanks for giving me the suggestion
|
|
|
|
|
u r welome
i had a similar experience so i adviced u??
and many have fire me for posting questions in the manner u have just done
take it easy man
|
|
|
|
|
If you want to get the string
"this is not a valid transaction." from the response,you can use this:
str.Substring(str.LastIndexOf("|")+1,str.Length-(str.LastIndexOf("|")+1))
where str="0|R002|this is not a valid transaction."
regards,
SRK
|
|
|
|
|
How about you have a crack at your own homework, and if you have a specific question about some of your code then im sure someone will help.
|
|
|
|
|
Hmmm Homework,
atleast start trying yourself
we can help you in some particular thing you are not able to do
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
if (T1.Text = "admin" && T2.Text = "admin")
{
Console.WriteLine("Login success");
}
wasts wrong in this code..
am getting error
self confidence+hard work=SUCCESS
|
|
|
|
|
use
if (T1.Text == "admin" && T2.Text == "admin")
Cheers!!
Brij
|
|
|
|
|
This is the most frequent programming error of all times: You used the assignment operator (= ) instead of the comparison operator (== ) in your if statement.
Use if (T1.Text == "admin" && T2.Text == "admin") instead, and everything is fine...
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Thanks Briji and thomas,
self confidence+hard work=SUCCESS
|
|
|
|
|
Your controls are poorly named, your username and password are hard coded and are the same ?
Oh, and you used = instead of ==.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a doubt in the enabling and disabling of menustrip items and subitems (C#.Net).
This is to be done based on user permission settings for every level and sublevel of menus.
I would like to use a recursive function to make this happen.
I am setting the userlevel(menu id) as the tag of each menustripitem.
Can anyone help me to achieve this?
This is very urgent.
regards,
sunitha
SRK
|
|
|
|
|
Here is how you can traverse through the menu items recursively:
foreach (ToolStripMenuItem item in menuStrip1.Items) {
process(item);
}
private void process(ToolStripMenuItem item) {
MessageBox.Show(item.Text);
if (item.DropDownItems.Count == 0) return;
foreach (ToolStripMenuItem subitem in item.DropDownItems) {
process(subitem);
}
}
Regards,
Lev
|
|
|
|
|
Thanks Lev for your help.
But my problem is that i am using a datatable to find the user levels of the logged on user.the data retrieved from the datatble has values like :-
8(main menu item)
8.01(sub menu)
8.02
8.03
8.04
8.04.01(sub item of 8.04)
8.04.02
8.05
8.06
8.06.01(sub item of 8.06)
8.06.02
8.06.02.01(sub item of 8.06.02)
8.06.02.02
these values are the menu ids that i set in the user permission screen.
I want to iterate thru the datatable as well.getting a bit confused with all the looping.
Please help me out...........
thanks in advance
SRK
|
|
|
|
|
You can associate a user level (say an integer, as a Tag) with menu item, then get the current user privilege level and finally iterate through the menu (with the code I posted) and disable those items whose privilege level is higher than the current one. This way you won't have any looping problems, just go through the menus recursively
Regards,
Lev
|
|
|
|
|
Lev,
this is the current code i am using:-
private void SetUserPermissions(int userId,int grpId)
{
DataTable objDt = objUserlBus.GetAllUserLevel(userId);
for (int i = 0; i < objDt.Rows.Count; i++)
{
foreach (ToolStripMenuItem menu in objMain.menuStrip1.Items)
{
if (objDt.Rows[i][1].ToString() == menu.Tag.ToString())
{
menu.Enabled = true;
}
EnableMenu(menu, objDt, 0);
}
}
}
private void EnableMenu(ToolStripMenuItem tm, DataTable dt, int strt)
{
try
{
foreach (ToolStripMenuItem item in tm.DropDownItems)
{
for (int i = strt; i < dt.Rows.Count; i++)
{
if (_usrGrp == 2 && item.Tag.ToString() == "7.01")
continue;
if (item.Tag.ToString() == dt.Rows[i][1].ToString())
{
item.Enabled = true;
EnableMenu(item, dt, i + 1);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Please go thru this n verify whether i have gone wrong anywhere.
regards,
SRK
|
|
|
|
|
Why are you getting all the users permissions? There is only one user that works with the program instance. It is enough to get current user's permission level, and then iterate through the menus, tuning it as you need
Regards,
Lev
|
|
|
|
|
I am getting only the currently logged in user's permissions into the datatable,by passing his userid.I think you got confused by then name of the function.
SRK
|
|
|
|
|
Well, I see,
You are storing all the menu IDs applicable to the user permissions in a DB and then enable/disable the menu items with this IDs, am I right?
I don't think this is efficient, you are storing a lot of redundant data, try to do it the way I suggested. Do not keep menu IDs in the DB, instead keep the user privilege level, associate it with each menu item. This way you will get just the user permissions level from db (an integer for example) and compare it with the level associated with the menu item. See my previous post.
Regards,
Lev
|
|
|
|
|
I dont understand how the data will b eredundant,as the fields in the usrlvlmas table are usr_id n menu_id.
Each time new permissions are set for the user,all the existing levels for that user are deleted and only new ones are updated.
Anyway let me have a try again.
SRK
|
|
|
|
|
The key of my suggested approach is having general permission groups (levels, like admin, power user, restricted user) and not individual permissions for each and every user, that's generally the way it is being done (e.g. in Asp.Net membership providers).
Regards,
Lev
|
|
|
|
|