|
|
Hello!
I have written a C# program and I set a file to start my program when I double click it. How can I find path of the file which has started my application? HELP!
|
|
|
|
|
if you double-click a file with a known extension, it launches its app
and Windows Explorer puts the full file path on the command line.
So you need to grab the command line; you get it (split into parts) as
the parameters of your static Main method. Alternatively you can access it
through some classes, e.g. Environment.CommandLine (not split, and includes
the path the app itself in front).
BTW if you select multiple files, then double-click, they should all
appear on the command line, so you may want to iterate over all the parts
of the command line.
|
|
|
|
|
|
|
Oh.. thanks. That will help me a lot!
|
|
|
|
|
I dont know why this is so hard. I just cant get it to work!!! I've tried a million things and different ways. I get this error: WebService1.Class1 cannot be serialized because it does not have a parameterless constructor.
public class Class1 : System.Web.Services.WebService
{
public string _strOne;
public string _strTwo;
public Class1(string strOne, string strTwo)
{
this._strOne = strOne;
this._strTwo = strTwo;
}
[WebMethod]
public Class1 HelloWorld(string str1, string str2)
{
return new Class1(str1,str2);
}
}
|
|
|
|
|
brsecu wrote: I get this error: WebService1.Class1 cannot be serialized because it does not have a parameterless constructor.
So have you tried to add parameterless constructor?
public Class1()
{
}
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Yeah. Now i get this error. System.NotSupportedException: Cannot serialize member System.ComponentModel.MarshalByValueComponent.Site of type System.ComponentModel.ISite because it is an interface.
Here is my code.
Ughhhhhhhhhhh
namespace WebService1
{
///
/// Summary description for Class1
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class Class1 : System.Web.Services.WebService
{
public string _strOne;
public string _strTwo;
public Class1()
{
}
public Class1(string strOne, string strTwo)
{
this._strOne = strOne;
this._strTwo = strTwo;
}
[WebMethod]
public Class1 HelloWorld(string str1, string str2)
{
str1 = "1";
str2 = "2";
return new Class1(str1, str2);
}
}
}
|
|
|
|
|
|
Have you tried adding the constructor?
public Class1()
{
} Types can't be serialized if they don't have a default (parameterless) constructor.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Thanks. I don't know how i missed that. but now i'm getting a new error. WIll you look at it above? Thanks. It seems pretty simple.
|
|
|
|
|
somePanel.add(lable1);
lable1.TextAlign = ContentAlignment.BottomCenter;
ps. I tried fill docking, anchoring but nothing seems to change
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
The text is only going to align within the label itself, so if you want it to align within the panel, it needs to be the same size as the panel.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
I have a button "Change PAssword". When user clicks on that it displays a form like:
Old P/w:
New P/W:
Confirm New P/W:
& then a "proceed" button.
whenever user enter all these details & press Proceed, that new password should get overwrite by the one already exists in the database.
How is it possible? Could any one help me on this.....
Thanks in Advance!
|
|
|
|
|
Well, I guess you want to write a procedure that takes the id of the currently logged in person, checks if the old password entered was correct for that user, and changes it to the new password. That seems pretty obvious, but we can't offer more help than that because, beyond the trivial overview, the specifics are entirely dependant on the specifics of your database schema.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This is a really trivial process. First, you want to check that the user credentials are correct. If so, check the new password against the confirmed new password. If all is good, then run an update query based on whatever your database schema is.
"That's no moon, it's a space station." - Obi-wan Kenobi
|
|
|
|
|
this is a bit long process and it includes learning and reading
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
Hi,
I have a question.
I have a comobox, i've bind data something like this
oleDbDataAdapter1.Fill(dataSet11);
DropDownList1.DataSource = dataSet11.Tables[0].DefaultView;
DropDownList1.DataTextField = dataSet11.tbacdes.ac_headColumn.ToString(); //Display AC Head
DropDownList1.DataValueField = dataSet11.tbacdes.ac_idColumn.ToString(); // Display AC Id
DropDownList1.DataBind();
first of all is correct. Now I want to to show Account Header in comobox and when user select any value than selectindex pass header id this my question, please help me out init.
Example
=======
[Student Fee] Display value and in backend of this entry in comobox header id is 2
I'm using asp.net 1.1, C#.Net.
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
Did you just mentioned (Urgent) in your post and (Butt) in your name
Ouch!!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
| Muhammad Waqas Butt | wrote: C#.Net ASP (Urgent)
OK, that really doesn't tell us much, except that you couldn't find the ASP.NET forum, and you're impatient.
| Muhammad Waqas Butt | wrote: DropDownList1.DataBind();
1 - please give your variables real names. I am astounded how many people post code here and have not set meaningful variable names
2 - do this only on the first call ( check for !IsPostback ), otherwise, your selected index will be lost on postback
3 - handle the SelectedIndexChanged event, then the form will postback when you change the selection ( or add a button so users have to select to do this ) and then in there, check the SelectedValue property, use int.TryParse to get it as a number, if it's a number, and do whatever database calls, etc you want with it from there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: | Muhammad Waqas Butt | wrote:
DropDownList1.DataBind();
1 - please give your variables real names. I am astounded how many people post code here and have not set meaningful variable names
Yes, this is one of my peeves. People that do this can have loads of fun debugging when they have multiple forms with more than one DropDownList1 in their project if they do so.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
hi
well I'm making an application in which i need to take data from a text file and its a CSV file having data in this format:
Name,DateOfBirth,Age
Now I have got the data from it but I wanna represent it in XML format. I hae no previoud experience of working in XML. SO can u plz tell me how to do this?
Rocky
|
|
|
|
|
First make an idea on how your XML file should look. Make tags what you are going to use. Then split your CSV data with "," and get result in an array. Use XMLTextWriter class to create XML file. Start a loop and read all array values and write to XML file using XMLTextWriter object
|
|
|
|
|
ok thanks I'll try it out
|
|
|
|