I'm using Nunit for unit testing, and added another project called "Unit Testing" to my current solution. I referenced Nunit, and changed the Namespace to the same namespace used in the main project.
I can't seem to figure out how to get access to all the classes, files, etc in the main project. Is there something I have to do to link two projects?
I am about to give up debugging SMTP servers to send email... My code is the following
private void SendMail()
{
SmtpClient mailClient = new SmtpClient("smtp.mail.yahoo.com", 465);
mailClient.EnableSsl = true;
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = "i wish it would work";
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
message.From = fromAddress;
mailClient.Send(message);
}
Is it possible to redirect a web apps results to a second application? I cannot parse the html source. It contains the javascript functions that execute the queries but all the content is probably server side.
I hope this makes sense. The owner has made the script available but I am not sure how this helps. Can I using .net call the site and redirect results perhaps to a file or database?
the app accesses one of googles apis and performs searches/queries and returns results which are displayed on the site. Now all the javascript functions that perform these queries are listed in the source but I do not know javascript so it does not make much sense to me.
I have used the documentation which uses the oauth protocol to access the api and have implemented that in my web app but it took me nearly a week to get the request token right and now to send requests to the api, sometimes I get one result back and sometimes none. It is frustrating me and the owner of the web app has given use of his script but he says all that happens is that my browser interacts with the google api and not his server.
So I thought why not have my web app call his, since his interacts with the API flawlessly and have the results sent to my app to save in a database.
I have very little experience here so pardon my ignorance
I did ask whether this was possible in 2008 which was answered in http://stackoverflow.com/questions/1296840/read-and-step-into-net-framework-source-code.
However my problem is that I am using 2005 and not 2008.
Does anyone know whether this is possible please??
The reason I want to do this is to better understand C# paradigms.
With Java this is possible and I learnt a tremendous amount by being able to read code written by engineers
Hello friends,
I want to display and update user profile using FormView control. But I dont know exactly how to do this.
I am using custom providers for Roles, Membership and Profile. Everything is working fine.
Can anybody provide solution?
Thanks for sharing your valuable time.
Got a Win7 box with VS2010 Premium installed on it.
Building desktop apps works just fine.
But we got this solution with 15 SL4 and 21 desktop projects... Building the SL part of it takes too long. This is very irritating and encourages to drop TDD since every time I run a test it takes ~3 seconds for msbuild to find out that nothing changed and the project should be skipped. The projects are very small and there's nothing fancy in them and we hadn't any problems before we switched from VS2008+SL3.
I've heard people complaining abound VS2010 speed in general, but nothing about SL4 build time.
Is anyone experiencing same problems and is there any workaround for this?
Hi,
I would like to know following: I added the folder "Graphics" into my project and placed one BMP to it. Now I would like to load the image from my code, but I cannot figure out how. I know its simple with resources but is there a way without adding the image into resources? Thanks
Is there a way to simplify the process of adding an overloaded method in C# using VS2005?
In VB6, I would have just added an Optional parameter the function, but in C# do I have to have to type out a whole new method with this new parameter?
I used the following code for checking user name and password. and I want ti block the user name after 3 invalid password attempt. what should I add in my codeing
MD5CryptoServiceProvider md5hasher = new MD5CryptoServiceProvider();
Byte[] hashedDataBytes;
UTF8Encoding encoder = new UTF8Encoding();
hashedDataBytes = md5hasher.ComputeHash(encoder.GetBytes(TextBox3.Text));
StringBuilder hex = new StringBuilder(hashedDataBytes.Length * 2);
foreach (Byte b in hashedDataBytes)
{
hex.AppendFormat("{0:x2}", b);
}
string hash = hex.ToString();
SqlConnection con = new SqlConnection("Data Source=Shihab-PC;Initial Catalog=test;User ID=SOMETHING;Password=SOMETHINGELSE");
SqlDataAdapter ad = new SqlDataAdapter("select password from Users where UserId='" + TextBox4.Text + "'", con);
DataSet ds = new DataSet();
ad.Fill(ds, "Users");
SqlDataAdapter ad2 = new SqlDataAdapter("select UserId from Users ", con);
DataSet ds2 = new DataSet();
ad2.Fill(ds2, "Users");
Session["id"] = TextBox4.Text.ToString();
if ((string.Compare((ds.Tables["Users"].Rows[0][0].ToString()), hash)) == 0)
{
if (string.Compare(TextBox4.Text, (ds2.Tables["Users"].Rows[0][0].ToString())) == 0)
{
Response.Redirect("actioncust.aspx");
}
else
{
Response.Redirect("actioncust.aspx");
}
}
else
{
Label2.Text = "Invalid Login";
}
con.Close();
}
Per subject, how does msbuild decide whether it needs to rebuild a library (ie, invoke csc), or not, when it is run against a C# project file? I imagine (but want to confirm):
If there's no output directory, rebuild (duh :) )
If a C# file has changed, rebuild
If an included file marked copy-always has changed, rebuild
or is it smart enough to not rebuild, but just copy the file to the existing output?
If an included file marked copy-if-newer has changed, rebuild
same question as above
I'm using Tangible's editor and (no offense guys) it sucks. Its one painful step above notepad. But its (afaik) the only game in town.
Does anybody have any tips/tricks on creating T4 templates in a non-painful way?
For instance, I'm thinking about creating a T4 Template that essentially turns a class defined in a solution into a template generator. DTE, look for code that is marked with this or that attribute, run this or that method, and drop the results into a file. At least I'd get legit intellisense out of the deal...
We are using VSS for version control (changing to another version control system is not an option right now), and are occassionally running into issues where a file has been completely deprecated with its functionality split into other new files. For historical archival reasons we need to keep those files in the version control sytem. Is there some way to clearly mark them as deprecated and no longer used?
I have a page that refreshes every 20 seconds and I need to know when it is done refreshing, the DocumentCompleted event does not fire when you refresh for some reason. Any ideas?
I answered this [question][1] and somebody else had answered as
he modern C++ equivalent would be a
sentry object: construct it at the
beginning of a function, with its
constructor implementing call(), and
upon return (or abnormal exit), its
destructor implements
I am not familiar with using sentry objects in C++.
I thought they were limited to input and output streams.
Could somebody explain to me about C++ sentry objects as well as how to use them as an around interceptor for one or more methods in a class ?
[1]: http://stackoverflow.com/questions/2688043/call-return-feature-of-classic-cc-with-classes-what-modern-languages-have-it/2688095#2688095 /
I have a query hitting EF4 using STEs and I'm having an issue with user-defined sorting. In debugging this, I have removed the dynamic sorting and am hard-coding it and I still have the issue. If I swap/uncomment the var results = xxx lines in GetMyBusinesses(), my results are not sorted any differently - they are always sorting it ascendingly.
FYI, Name is a varchar(200) field in SQL 2008 on my Business table.
private IQueryable<Business> GetMyBusinesses(MyDBContext CurrentContext)
{
var myBusinesses = from a in CurrentContext.A
join f in CurrentContext.F
on a.FID equals f.id
join b in CurrentContext.Businesses
on f.BID equals b.id
where a.PersonID == 52
select b;
var results = from r in myBusinesses
orderby "Name" ascending
select r;
//var results = from r in results
// orderby "Name" descending
// select r;
return results;
}
private PartialEntitiesList<Business> DoStuff()
{
var myBusinesses = GetMyBusinesses();
var myBusinessesCount = GetMyBusinesses().Count();
Results = new PartialEntitiesList<Business>(myBusinesses.Skip((PageNumber - 1)*PageSize).Take(PageSize).ToList())
{UnpartialTotalCount = myBusinessesCount};
return Results;
}
public class PartialEntitiesList<T> : List<T>
{
public PartialEntitiesList()
{
}
public PartialEntitiesList(int capacity) : base(capacity)
{
}
public PartialEntitiesList(IEnumerable<T> collection) : base(collection)
{
}
public int UnpartialTotalCount { get; set; }
}
Hello --
We are moving our SL3 app to SL4. First step was to open it in VS2010; it converted w/o problem.
However, parameters specified for the start page are not passed along.
That is, if we specify
ourStartPage.aspx?Slam=Dunk&Glass=Sun
in app.xaml.cs, Application_Startup(), e.InitParams is empty.
How do we fix this?
Thanks for any advice....
(Note that the very same startup string worked in VS2008.)
I would like to switch my application to LARGEADDRESSAWARE. One of issues to watch for is pointer arithmetic, as pointer difference can no longer be represented as signed 32b.
Is there some way how to find automatically all instances of pointer subtraction in a large C++ project?
If not, is there some "least effort" manual or semi-automatic method how to achieve this?
Hi guys,
Have two machines, both with VS2005 SP1 installed and with the WinSXS showing the same things installed.
When one machine builds a particular C++ .dll .vcproj it ends up with
<assemblyIdentity type='win32' name='Microsoft.VC80.MFC' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
in its manifest file. But on the other machine it ends up with
<assemblyIdentity type='win32' name='Microsoft.VC80.MFC' version='8.0.50608.0 processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
even though this machine does not have '8.0.50608.0' libraries listed in its WinSXS.
The .dll built on this machine with the older version referenced has some problems. I have ensured both machines have the same latest source code and references etc..
What could be causing it to build with the different reference?
Thanks!
Terry
Hi,
I need to implement the Win2k3 password validation policy. As my application resides on Win2k3 cane we validate the password directly with windows domain password by using LDAP. This is because application design does not want to store 8/more password entry into DB and validate new password against that. As Windows already does same thing and using LDAP we can lookup into windows server.
Can any one please let me know LDAP API to fulfill above requirement in VC++.
Wednesday I had to restore from a back-up image I made on Monday. At the time of the snapshot I had about 20 files modified, which I later checked in, and more, on Tuesday. Now that I am back to a snapshot from Monday morning, my workspace has all of these files checked-out or added, etc. even my check-in comments and work-item associations. But I already did that check-in on Tuesday.
I'm thinking I will shelve all the pending changes (just in-case), and then just undo all changes, and get latest (specific version). And I should be back to good.
Any cautions or suggestions?
(TFS 2008, VS2010)
When you right click and do a Select top 1000 rows from a table in sql 2008, it opens a tab and writes the sql and then executes it. This is okay, however I'll erase the sql and use the same tab often to do other sql statements. What annoys me is that I have to go to the database drop-down at the top of the window and change it to the current database I'm in because it says Master.
How can I make sql 2008 update the selected database for this tab automatically when I right click a table and do select top 1000?
On a side note, can I automatically hide the select statement that it generates and just show grid of results?
Hello
I'm using C#.Net and have a base form that is inherited by several forms.
Until yesterday, when the child (derived) form was opened in the designer the base forms controls would be displayed and shown as locked.
Now, however the form is simply blank. None of the base forms controls are visible in the designer. Everything compiles, builds and runs OK.
Has anyone else seen this?
I've tried placing a call to the base forms InitializeComponent method in the derived forms OnLoad method but to no avail.
Below is my code...
ID3D10Texture2D *pBackBuffer;
hr = mpSwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*) &pBackBuffer);
and I get the following error
chp1.exe': Unloaded 'C:\Windows\SysWOW64\oleaut32.dll'
First-chance exception at 0x757ce124 in chp1.exe: Microsoft C++ exception: _com_error at memory location 0x0018eeb0..
First-chance exception at 0x757ce124 in chp1.exe: Microsoft C++ exception: _com_error at memory location 0x0018edd0..
First-chance exception at 0x757ce124 in chp1.exe: Microsoft C++ exception: _com_error at memory location 0x0018ef1c..
The thread 'Win32 Thread' (0xfc4) has exited with code 0 (0x0).
'chp1.exe': Unloaded 'C:\Windows\SysWOW64\D3D10Ref.DLL'
First-chance exception at 0x00b71894 in chp1.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled ex
ception at 0x00b71894 in chp1.exe: 0xC0000005: Access violation reading location 0x00000000.
It appears that the error occurs in the last parameter. &pBackBuffer. I added this single line of code and the error occurs.