Search Results

Search found 21097 results on 844 pages for 'check snmp'.

Page 84/844 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • How to check whether a excel file is write protected or not in C#?

    - by Pavan Navali
    Hi, I'm developing a sample application in which I have to open an excel file and check whether the file is write protercteed or not. The code is using System.Windows.Forms; using Microsoft.Office.Core; private void button1_Click(object sender, EventArgs e) { string fileNameAndPath = @"D:\Sample\Sample1.xls"; // the above excel file is a write protected. Microsoft.Office.Interop.Excel.Application a = new Microsoft.Office.Interop.Excel.Application(); if (System.IO.File.Exists(fileNameAndPath)) { Microsoft.Office.Interop.Excel.ApplicationClass app = new Microsoft.Office.Interop.Excel.ApplicationClass(); // create the workbook object by opening the excel file. app.Workbooks.Open(fileNameAndPath,0,false,5,"","",true,Microsoft.Office.Interop.Excel.XlPlatform.xlWindows,"\t",false, true, 0,false,true,0); Microsoft.Office.Interop.Excel._Workbook w = app.Workbooks.Application.ActiveWorkbook; if (w.ReadOnly) MessageBox.Show("HI"); // the above condition is true. } } I would like know whether the file is write protected or not.

    Read the article

  • How to check if the internal typedef struct of a typedef struct is NULL ?

    - by watchloop
    typedef struct { uint32 item1; uint32 item2; uint32 item3; uint32 item4; <some_other_typedef struct> *table; } Inner_t; typedef struct { Inner_t tableA; Inner_t tableB; } Outer_t; Outer_t outer_instance = { {NULL}, { 0, 1, 2, 3, table_defined_somewhere_else, } }; My question is how to check if tableA is NULL just like the case for outer_instance. It tried: if ( tmp->tableA == NULL ). I get "error: invalid operands to binary =="

    Read the article

  • How can I check a user/password combination on an ActiveDirectory without putting the password in a String?

    - by Jean Hominal
    I want to check User/Password combination on a Windows domain. Right now I do it with the following code: bool Login(String username, String password) { var principalContext = new PrincipalContext(ContextType.Domain); principalContext.ValidateCredentials(username, password); } While it works, the thing that bugs me is that I have to put the password in a String in order to use that API; as I am using a SecureString to store the password everywhere else, I would really like to use some way of checking the username / password combination without having to pass the password as a managed System.String. What would be the best way of achieving that?

    Read the article

  • How to check using a script if project is opened in XCode?

    - by delirus
    Hi, I'd like to introduce build number feature for my iPhone project and increase it automatically with every commit to my git repo. I plan to do it using Apple's agvtool, which recommends that project is not opened in XCode at the time So my questions are: 1) So far I know that I need to make an executable script from .git/hooks/pre-commit.sample. How to do the scripting to check if certain project is opened in XCode? 2) pre-commit.sh will be executed upon calling git commit with no args, so whenever someone will commit with -a option, I won't have my build number updated. Is there any way to workaround this? Cheers

    Read the article

  • How to check if a process is running or got segfaulted or terminated in linux from its pid in my mai

    - by rkbang
    Hello all, I am invoking several processes in my main and I can get the pid of that processes. Now I want to wait until all this processes have been finished and then clear the shared memory block from my parent process. Also if any of the process not finished and segfaulted I want to kill that process. So how to check from the pid of processes in my parent process code that a process is finished without any error or it gave broke down becoz of runtime error or any other cause, so that I can kill that process. Also what if I want to see the status of some other process which is not a child process but its pid is known. Code is appreciated( I am not looking for script but code ).

    Read the article

  • How to find the width of the div or check wheather horizontal scroll apeear or not?

    - by Salil
    I want to print the page (div) if there is no horizontal scroll appear for that div. I have a div (1000px) with dynamic data which having property overflow:auto;. So, i want to print the div only if div's width is not getting crossed. to achieve this i used following method of a javascript var curr_width = parseInt(mydiv.style.width); But it gives 1000px; only althogh i can see horizontal scrollbar for the div. What should i do to achive this. Can i check wheather horizontal scrollbar is appear for the div or not. Any help is appreciated. NOTE:- i don't want to use any javascript library.

    Read the article

  • An elegant / simple way to check whether internet is available or not.

    - by Trainee4Life
    I did a quick search on how to check whether Internet is available or not. Most of them talked about making InterOp calls to wininet.dll. One of the answers pointed towards System.Net.NetworkInformation namespace. Exploring the namespace I found a class Ping which could be used to pinging to our servers from code, and checking whether server is available or not. What I want to ask is how this solution compares to other solutions? Ping soPing = new Ping(); var soPingReply = soPing.Send("www.stackoverflow.com"); if (soPingReply.Status != IPStatus.Success) { // SO not available }

    Read the article

  • How to check whether a mysql select statement result has a value or not in php?

    - by udaya
    I have a textbox UserName and a Check Availability button next to it..... I have checked the availability by passing UserName textbox value..... But it doesn't seem to work.... Here is what i am doing? echo $UserName = $_GET['CheckUsername']; $_SESSION['state'] = $State; $queryres = "SELECT dUser_name FROM tbl_login WHERE dUser_name='$UserName'"; $result = mysql_query($queryres,$cn) or die("Selection Query Failed !!!"); if($result==true) // this condition doesn't seem to work { echo "User Name Available"; } else { echo "Sorry user name taken"; }

    Read the article

  • Check one element on last row of a table is not empty using Jquery.

    - by Cesar Lopez
    I have the following function: var emptyFields = false; function checkNotEmpty(tblName, columns, className){ emptyFields = false; $("."+className+"").each(function() { if($.trim($(this).val()) === "" &amp;&amp; $(this).is(":visible")){ emptyFields = true; return false; // break out of the each-loop } }); if (emptyFields) { alert("Please fill in current row before adding a new one."); } else { AddRow_OnButtonClick(tblName,columns); } } Its checking that all elements in the table are not empty before adding a new row, and I only need to check that the last row of the table has at least an element which its not empty and not the whole table. Any help would be apreciated. Thanks

    Read the article

  • How can I check the type of an object against a list of types?

    - by RookieRick
    Given a collection IEnumerable<Type> supportedTypes What's the best way to check whether a given object is one of those types (or a derived type)? My first instinct was to do something like: // object target is a parameter passed to the method in which I'm doing this. if (supportedTypes.Count( supportedType => target is supportedType ) > 0) { // Yay my object is of a supported type!!! } ..but that doesn't seem to be working. Can I not use the "is" keyword in a lambda expression like this?

    Read the article

  • How to check a Web Service for an updated version of a locally stored XML file on the iPhone/iPod To

    - by Toret
    Hello, I'm currently working on an application that needs to check a web service for an updated version of a locally stored XML file. If there is an update the file must then be downloaded and saved to the iPhone. I'm not really sure what direction I need to head in. Currently I know that I can use NSURLConnection delegate methods to establish a connection and receive a response but I'm not sure how to implement this with the web service to grab the file and replace the current one that is stored on the iPhone. Any help would be greatly appreciated.

    Read the article

  • How can I create a boolean in the `if` statement within the for loop to check for existence of term prepended to filename %%f?

    - by user784637
    I have lyrics for about 60% of my song collection. The filename of the lyrics is the same as the file name of song with zzz_ prepended to the filename and .lrc as the extension. C:\Songs\album\song.mp3 C:\Songs\album\zzz_song.lrc I currently print the file names like so for /r "C:\Songs" %%f in (*.mp3 *.flac) do ( echo %%f ) How can I create a boolean in the if statement within the for loop as a check on the existence of lyrics files? I was thinking something like if exist zzz_%f echo zzz_%f.lrc but zzz_%f prepends zzz_ to the full file path (ex. zzz_C:\Songs\album\song.mp3) and .lrc is appended to the existing extension

    Read the article

  • Java: How to check if a date Object equals yesterday?

    - by tzippy
    Right now I am using this code Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE) - 1, 12, 0, 0); //Sets Calendar to "yeserday, 12am" if(sdf.format(getDateFromLine(line)).equals(sdf.format(cal.getTime()))) //getDateFromLine() returns a Date Object that is always at 12pm {...CODE There's got to be a smoother way to check if the date returned by getdateFromLine() is yesterday's date. Only the date matters, not the time. That's why I used SimpleDateFormat. Thanks for your help in advance!

    Read the article

  • how to raise warning if return value is disregarded - gcc or static code check?

    - by Drakosha
    I'd like to see all the places in my code (C++) which disregard return value of a function. How can I do it - with gcc or static code analysis tool? Bad code example: int f(int z) { return z + (z*2) + z/3 + z*z + 23; } int main() { int i = 7; f(i); ///// <<----- here I disregard the return value return 1; } Update: it should work even if the function and its use are in different files free static check tool

    Read the article

  • How to check input text into web form? java script

    - by butteff
    how to check input text before POST operation? it must be numbers only <form method="post" action="credit.php"> ????? ???????: <input type="text" name="sum"> <br /> ?????? ?????: <input type="text" name="pv"> <br /> ????: <input type="text" name="srok"> <br /> ?????????? ??????: <input type="text" name="percent"> <br /> <input type="submit"> </form> sorry for my bad english.

    Read the article

  • how do I check if a c++ string is an int?

    - by user342231
    when I use getline, I would input a bunch of strings or numbers, but I only want the while loop to output the "word" if it is not a number. so is there any way to check if "word" is a number or not, I know I could use atoi() for c-strings but how about for strings of the string class int main () { stringstream ss (stringstream::in | stringstream::out); string word; string str; getline(cin,str); ss<<str; while(ss>>word) { //if( ) cout<<word<<endl; } }

    Read the article

  • Under Windows CE, how can I check which RAM based DLLs are loaded in virtual memory space?

    - by Michal Drozdowicz
    I have a problem with loading a DLL under Windows Mobile 5.0. I'm pretty confident that this is caused by running out of the application virtual memory (the 32 MB slot of the process, as explained in Windows CE .NET Advanced Memory Management). I'm looking for a way to actually make sure that this is the issue and investigate whether my efforts bring expected results. Do you know of a way to check the contents of the virtual memory application slot? Any applications that can help me with this task?

    Read the article

  • How to automatically check out a database file in a source controlled web application ?

    - by TheRHCP
    Hello, I am working on an ASP.NET web application, we are a small team (4 students) and we do not have access to a dedicated server to host the database instance. So for this web application we decided just to put the database file in the App_Data folder. The problem is that our project is source controled on TFS, so every time you open the solution and try to launch the web application, we get an expcetion saying that database is read-only. That is logical because the databse file is not automatically checked-out. Is there a workaround to avoid a manual check-out of the database file everytime we open the solution ? Thanks.

    Read the article

  • Is there any convenient way to check if a DOM element is `$compile`d in AngularJS?

    - by Tong Shen
    I'm trying to integrate some plain JavaScript library with AngularJS, in which I need to manually $compile some DOM elements. I'm doing the compilation like this: $compile(e.srcElement)($scope); e.srcElement is the DOM element I want to $compile. I wonder, if there is any established way to check if a given DOM element has been compiled. I know it's possible if I attach some data attributes to the DOM during compiling, and try to retrieve that later. What I want to know is if there is any existing method in AngularJS. Thank you!

    Read the article

  • How to check whether iterators form a contiguous memory zone?

    - by Vincent
    I currently have the following function to read an array or a vector of raw data (_readStream is a std::ifstream) : template<typename IteratorType> inline bool MyClass::readRawData( const IteratorType& first, const IteratorType& last, typename std::iterator_traits<IteratorType>::iterator_category* = nullptr ) { _readStream.read(reinterpret_cast<char*>(&*first), (last-first)*sizeof(*first)); return _readStream.good(); } First question : does this function seem ok for you ? As we read directly a block of memory, it will only work if the memory block from first to last is contiguous in memory. How to check that ?

    Read the article

  • How would I go about writing a conditional statement to check if visitor is coming from a particular

    - by Matthew
    Hello guys, What I have in mind is this... We are going to have people come from a particular site during a acquisition campaign and was wondering how I could conditionalize a certain section of my site to display a thank you message instead of the sign up form as they would have had the opportunity to fill this out before coming to my landing page. I have seen solutions like: $referal = mysql_real_escape_string($_SERVER['HTTP_REFERER']); I would like to know if this is the best way to get this to work??? - okay this is what i think might work. The third party website that is referring people to our landing page once the form on that site has been filled out can push into the record a hidden input value of "www.sample.com" or whatever... then I can have something check the for that particular value and fire off the conidtional. Does that even sound right?

    Read the article

  • How to check that this event would occur after DOM is ready in jquery ?

    - by Rachel
    I want to get page_tag information from the page and want to make sure that DOM for this page is already ready before getting the page tag information. I am doing $(document).ready( { alert("test"); var page_tag : $("head meta[name='page_tag']").attr('content'); page_tag : (page_tag) ? page_tag : ''; } But it gives me errors, missing : after property id alert("Check if document is ready");\n Any suggestions on what could be the possible reasons for it or any other way of checking if the dom is ready or not before getting page_tag information.

    Read the article

  • Is there a way to check if a host is up?

    - by Rob
    I'm trying to do this in PHP. I need to check if a specified host is "up" I thought of pinging the specified host (though I'm not sure how I would, since that would require root. --help here?) I also though of using fsockopen() to try to connect on a specified port, but that would fail too, if the host wasn't listening for connections on that port. Additionally, some hosts block ping requests, so how might I get around this? This part isn't a necessity, though, so don't worry about this too much. I realize this one might get tricky.

    Read the article

  • How to check if Google Street View available and display message?

    - by Vafello
    I am passing lat and lng variables and display google sreet view in a div. The problem is that when the StreetView is unavilable then nothing is displayed. I would like to check if there is a streetview for a given lat and lng and display a message. Here is my code: var myPano = new GStreetviewPanorama(document.getElementById("street2"), panoOpts); var location = new GLatLng(lat,lng) myPano.setLocationAndPOV(location); Maybe I should use something like: Event.addListener(myPano, "error", errorMessage()); Any ideas?

    Read the article

  • In PHP can I check a boolean on a function call?

    - by Chris
    I have a function which checks the passed value and returns false or true, if false I want it to add something to an array. The code I've written is below. if(!check_input($_POST['username'])){ $errors[] = "Username"; } Right now it adds to my array anyway, regardless of what is entered in the form. Is the way I've written that the correct way to check if the return from check_input() is false? I've checked the function's logic by altering the returns to echoes and it's returning the correct value, I'm just not sure if I'm checking it wrong. I'd previously attempted to write it as $X=check_input etc, and then if(check_value == false) but that doesn't seem to give me the desired result either. Hmmm a quick pointer please!

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >